perm filename MEMO.XGP[HAL,HE]2 blob sn#128401 filedate 1974-11-07 generic text, type T, neo UTF8
/LMAR=0/FONT#0=BASL30/FONT#3=BASI30/FONT#4=BASB30/FONT#5=BDR40/FONT#6=LPT

␈↓ ↓H␈↓STANFORD ARTIFICIALL INTELLIGENCE LABORATORY ␈↓ 	ASEPTEMBER 1974
␈↓ ↓H␈↓MEMO AIM-243


␈↓ ↓H␈↓COMPUTER SCIENCE DEPARTMENT
␈↓ ↓H␈↓REPORT CS-456




␈↓ ↓H␈↓␈α?␈α?␈α?␈α5␈↓¬'AL, A Programming System for Automation
␈↓ ↓H␈↓¬␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈αβ␈↓∧Preliminary Report




␈↓ ↓H␈↓∧␈α?␈α?␈απ␈↓Raphael Finkel, Russell Taylor, Robert Bolles, Richard Paul, Jerome Feldman








␈↓ ↓H␈↓␈↓ αH'AL,␈αa␈αnew␈αlanguage␈αfor␈αspecification␈αof␈αmanipulatory␈αactions,␈αis␈αdescribed.␈α It
␈↓ ↓H␈↓␈↓ αHis␈αthe␈αmost␈αrecent␈αin␈αa␈αseries␈α
of␈αefforts␈αin␈αthis␈αdirection,␈αa␈αseries␈α
including,␈αin
␈↓ ↓H␈↓␈↓ αHparticular,␈α⊃APT␈α⊂and␈α⊃WAVE.␈α⊃ The␈α⊂'AL␈α⊃system␈α⊂includes␈α⊃a␈α⊃source␈α⊂language
␈↓ ↓H␈↓␈↓ αHwith␈α
advanced␈αfeatures␈α
for␈αdescribing␈α
individual␈αmotions␈α
of␈αmanipulators␈α
and
␈↓ ↓H␈↓␈↓ αHcomplex␈α⊂series␈α⊂of␈α⊃motions␈α⊂making␈α⊂up␈α⊂an␈α⊃entire␈α⊂assembly,␈α⊂and␈α⊃the␈α⊂runtime
␈↓ ↓H␈↓␈↓ αHsystem necessary for execution of programs.










␈↓ ↓H␈↓__________________________________________________________________________________________␈↓ >  

␈↓ ↓H␈↓␈↓βThis␈α∩research␈α∩was␈α∩supported␈α∪in␈α∩part␈α∩by␈α∩the␈α∪National␈α∩Science␈α∩Foundation␈α∩under␈α∪contract␈α∩No.
␈↓ ↓H␈↓βGI-42906␈α∞and␈α∞in␈α∞part␈α∞by␈α∞the␈α∞Advanced␈α∞Research␈α∞Projects␈α∞Agency␈α∞of␈α∞the␈α∞Office␈α∞of␈α∞Defense␈α
under
␈↓ ↓H␈↓βContract No. DAHC-15-73-C-0435

␈↓ ↓H␈↓βThe␈α
views␈αand␈α
conclusions␈α
in␈αthis␈α
document␈α
are␈αthose␈α
of␈α
the␈αauthors␈α
and␈α
should␈αnot␈α
be␈αinterpreted␈α
as
␈↓ ↓H␈↓βnecessarily representing the official policies, either expressed or implied, of the funding agencies.

␈↓ ↓H␈↓βReproduced␈α∂in␈α∞the␈α∂USA.␈α∞Available␈α∂from␈α∞the␈α∂National␈α∞Technical␈α∂Information␈α∂Service,␈α∞Springfield,
␈↓ ↓H␈↓βVirginia 22151.␈↓
␈↓ ↓H␈↓Page ii␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α→FOREWORD␈↓ H



␈↓ ↓H␈↓This␈α
document␈αdescribes␈α
the␈αnew␈α
hand␈αlanguage,␈α
'AL.␈α It␈α
is␈αnot␈α
intended␈αto␈α
be␈αa␈α
final␈αlanguage
␈↓ ↓H␈↓specification␈αor␈α
a␈αuser's␈αmanual.␈α
 Rather,␈αit␈α
is␈αa␈αworking␈α
document␈αpresenting␈α
a␈αnumber␈αof␈α
related
␈↓ ↓H␈↓ideas␈α⊂concerning␈α∂a␈α⊂system␈α⊂for␈α∂programmable␈α⊂automation.␈α∂ These␈α⊂ideas␈α⊂cover␈α∂quite␈α⊂a␈α⊂range␈α∂of
␈↓ ↓H␈↓topics:␈α∪arm␈α∪servoing,␈α∪parallel␈α∪processing,␈α∪assembly␈α∪world␈α∪modelling,␈α∪strategists,␈α∪and␈α∩language
␈↓ ↓H␈↓design.␈α⊃ We␈α⊃have␈α⊂tried␈α⊃to␈α⊃combine␈α⊂these␈α⊃into␈α⊃a␈α⊂coherent␈α⊃system.␈α⊃ However,␈α⊂as␈α⊃you␈α⊃read␈α⊂this
␈↓ ↓H␈↓document␈α↔you␈α↔will␈α↔notice␈α↔that␈α↔some␈α⊗topics␈α↔have␈α↔been␈α↔explored␈α↔more␈α↔than␈α↔others,␈α⊗some
␈↓ ↓H␈↓explanations␈α
contain␈α∞more␈α
detail␈α
than␈α∞others,␈α
and␈α
some␈α∞questions␈α
are␈α
left␈α∞unanswered.␈α
 Various
␈↓ ↓H␈↓portions␈αof␈αthe␈αsystem␈αhave␈αalready␈αbeen␈αimplemented.␈αAt␈αpresent␈α'AL␈αis␈αstill␈αsomewhat␈αin␈αa␈αstate
␈↓ ↓H␈↓of flux; we are presenting these ideas to solicit constructive suggestions.

␈↓ ↓H␈↓Interested␈α
persons␈α
unfamiliar␈α∞with␈α
the␈α
background␈α
for␈α∞this␈α
work␈α
will␈α
find␈α∞it␈α
useful␈α
to␈α∞read␈α
␈↓βThe
␈↓ ↓H␈↓βUse of Sensory Feedback in a Programmable Assembly System␈↓ [Bolles].

␈↓ ↓H␈↓We␈α∂would␈α∞like␈α∂to␈α∞thank␈α∂those␈α∞people␈α∂who␈α∞have␈α∂already␈α∞made␈α∂numerous␈α∞suggestions␈α∂and␈α∞have
␈↓ ↓H␈↓helped␈αimplement␈αvarious␈αparts␈αof␈αthe␈αsystem.␈α In␈αparticular,␈αwe␈αwould␈αto␈αthank␈αBertrand␈αMeyer,
␈↓ ↓H␈↓who␈α
implemented␈αthe␈α
scanner␈αand␈α
parser,␈αand␈α
Bo␈α
Eross,␈αwho␈α
is␈αimplementing␈α
the␈αPDP11␈α
runtime
␈↓ ↓H␈↓monitor.␈α
 We␈α
would␈α
also␈α
like␈α
to␈α∞thank␈α
Bruce␈α
Baumgart,␈α
who␈α
assisted␈α
with␈α
the␈α∞illustrations,␈α
and
␈↓ ↓H␈↓Larry Tesler, whose document preparation program PUB was used to prepare this paper.

␈↓ ↓H␈↓The␈αEnglish␈αlanguage␈αhas␈αno␈αgenderless␈αpersonal␈αpronoun;␈αwithout␈αany␈αimplication␈αof␈αsexism␈αwe
␈↓ ↓H␈↓use the feminine form in its place.
␈↓ ↓H␈↓␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α_TABLE OF CONTENTS␈↓ 
dPage iii



␈↓ ↓H␈↓CHAPTER ␈↓ 
rPAGE
␈↓ ↓H␈↓    .0  PHILOSOPHY AND DESIGN GOALS <<REVISED>> ␈↓ 91
␈↓ ↓H␈↓        .0.1  DATA AND CONTROL STRUCTURES ␈↓ 91
␈↓ ↓H␈↓        .0.2  MOTION SPECIFICATIONS ␈↓ 92
␈↓ ↓H␈↓        .0.3  THE DATABASE AND ITS USES ␈↓ 92
␈↓ ↓H␈↓        .0.4  THE RUNTIME SYSTEM ␈↓ 94
␈↓ ↓H␈↓        .0.5  PROGRAMMING AIDS ␈↓ 95
␈↓ ↓H␈↓    .1  GENERAL SYSTEM OUTLINE ␈↓ 96
␈↓ ↓H␈↓        .1.1  HARDWARE ␈↓ 96
␈↓ ↓H␈↓        .1.2  SOFTWARE ␈↓ 96
␈↓ ↓H␈↓    .2  DATA STRUCTURES ␈↓ 99
␈↓ ↓H␈↓        .2.1  DATA TYPES ␈↓ 99
␈↓ ↓H␈↓        .2.2  ALGEBRAIC DATA TYPES: SCALARS ␈↓ 99
␈↓ ↓H␈↓        .2.3  OTHER ALGEBRAIC DATA TYPES ␈↓ *11
␈↓ ↓H␈↓        .2.4  PLANNING VALUES ␈↓ *15
␈↓ ↓H␈↓        .2.5  ARITHMETIC ␈↓ *16
␈↓ ↓H␈↓        .2.6  SOME EXAMPLES OF ARITHMETIC EXPRESSIONS ␈↓ *17

␈↓ ↓H␈↓APPENDICES
␈↓ ↓H␈↓␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α
␈↓ 
pPage 1



␈↓ ↓H␈↓REQUIRE "MINTRO.PUB" SOURCE_FILE; <<MEMO25(2) Introduction>>





␈↓ ↓H␈↓␈↓∧.0 PHILOSOPHY AND DESIGN GOALS <<REVISED>>␈↓

␈↓ ↓H␈↓A␈α∞full␈α
language␈α∞for␈α
planning␈α∞manipulatory␈α
tasks␈α∞of␈α
the␈α∞complexity␈α
required␈α∞for␈α∞assembly␈α
needs
␈↓ ↓H␈↓many␈α∩features,␈α∩some␈α∩of␈α∩which␈α∩do␈α∩not␈α∩exist␈α∩in␈α∩any␈α∩current␈α∩system.␈α∩ We␈α∩have␈α∪identified␈α∩the
␈↓ ↓H␈↓following interrelated goals.



␈↓ ↓H␈↓␈↓β.0.1 DATA AND CONTROL STRUCTURES␈↓

␈↓ ↓H␈↓We␈α
believe␈α
that␈α
the␈α
principal␈α
mode␈α
of␈α
input␈α
to␈α
'AL␈α
should␈α
be␈α
textual,␈α
as␈α
opposed␈α
to␈α∞spoken␈α
or
␈↓ ↓H␈↓manual␈α(joystick).␈α There␈αare␈αlevels␈αof␈αcomplexity␈αwhich␈αare␈αmuch␈αmore␈αreadily␈αtransmitted␈αfrom
␈↓ ↓H␈↓man␈α∂to␈α∞the␈α∂machine␈α∞through␈α∂the␈α∞interface␈α∂of␈α∞symbolic␈α∂text.␈α∞ Complicated␈α∂motions␈α∞of␈α∂two␈α∞arms
␈↓ ↓H␈↓simultaneously,␈αspecifications␈αof␈αwhat␈αconditions␈αto␈αbe␈αalert␈αto␈αduring␈αan␈αaction␈αare␈αmore␈αlikely␈αto
␈↓ ↓H␈↓be␈α
unambiguously␈α∞stated␈α
through␈α∞the␈α
medium␈α
of␈α∞text,␈α
if␈α∞for␈α
no␈α
other␈α∞reason␈α
than␈α∞the␈α
structure
␈↓ ↓H␈↓imposed␈α⊂on␈α⊂the␈α⊂textual␈α⊂language␈α⊂forces␈α∂a␈α⊂consistent␈α⊂framework␈α⊂on␈α⊂the␈α⊂initially␈α⊂less␈α∂structured
␈↓ ↓H␈↓intuitive␈α∞ideas.␈α∞To␈α∞provide␈α∂for␈α∞general␈α∞spoken␈α∞input␈α∂would␈α∞require␈α∞significant␈α∞advances␈α∂in␈α∞the
␈↓ ↓H␈↓fields␈α∂of␈α∂speech␈α∂recognition␈α∞and␈α∂language␈α∂understanding.␈α∂ It␈α∂is␈α∞true␈α∂that␈α∂textual␈α∂as␈α∂opposed␈α∞to
␈↓ ↓H␈↓spoken/joystick␈αinput␈α
puts␈αa␈α
burden␈αon␈αthe␈α
programmer;␈αhe␈α
must␈αbe␈αable␈α
to␈αtype,␈α
and␈αto␈αlearn␈α
the
␈↓ ↓H␈↓syntax.␈α We␈αhope␈αthat␈αthe␈α
supervisor␈αlevel␈αof␈α'AL␈αwill␈α
be␈αsimple␈αenough␈αto␈αallow␈αnatural␈α
learning
␈↓ ↓H␈↓by␈α
showing.␈α
 We␈α
do␈α
not␈α
have␈α
joysticks,␈α
and␈α
therefore␈α
currently␈α
depend␈α
on␈α
releasing␈α
brakes␈α
and
␈↓ ↓H␈↓manually␈α⊃moving␈α⊂the␈α⊃arm.␈α⊂ We␈α⊃do␈α⊃not␈α⊂have␈α⊃facility␈α⊂for␈α⊃vocal␈α⊂input,␈α⊃and␈α⊃therefore␈α⊂currently
␈↓ ↓H␈↓depend␈αon␈αtyped␈αinput.␈α However,␈αneither␈αof␈αthese␈αrestrictions␈αis␈αcentral␈αto␈αthe␈αdesign␈αof␈α'AL;␈αit␈αis
␈↓ ↓H␈↓fairly easy to see how such additional features could be interfaced into the system.

␈↓ ↓H␈↓The␈αdatatypes␈αavailable␈αshould␈αinclude␈αthose␈αnecessary␈αto␈αrefer␈αto␈αone-dimensional␈αmeasures␈α(like
␈↓ ↓H␈↓distance,␈α≥time,␈α≥mass)␈α≥and␈α≡three-dimensional␈α≥measures␈α≥(like␈α≥directed␈α≡distance,␈α≥locations,
␈↓ ↓H␈↓orientations).␈αArithmetic␈αoperators␈αshould␈αbe␈αavailable␈αnot␈αonly␈αfor␈αthe␈αstandard␈αscalar␈αoperations
␈↓ ↓H␈↓like multiplication and addition, but also for such operations as rotation and translation.

␈↓ ↓H␈↓We␈αwant␈αto␈αwrite␈αentire␈αprograms␈αin␈αa␈αnatural␈αmanner.␈α The␈αmachine-language␈αaspect␈αof␈αcurrent
␈↓ ↓H␈↓manipulation␈αlanguages␈αmakes␈αit␈αcumbersome␈αto␈αwrite␈αlong␈αprograms␈αin␈αany␈αstructured␈αway.␈α We
␈↓ ↓H␈↓want␈α
a␈α
language␈α
which␈α
lends␈α
itself␈α
to␈α
a␈α
more␈α
systematic␈α
and␈α
perspicuous␈α
programming␈α
style.␈α
Algol-
␈↓ ↓H␈↓like control structures are a vast improvement over assembly-like straight code with jumps.

␈↓ ↓H␈↓Experience␈α
with␈α∞languages␈α
like␈α∞SAIL␈α
has␈α∞shown␈α
that␈α
text␈α∞macros␈α
are␈α∞an␈α
invaluable␈α∞feature␈α
for
␈↓ ↓H␈↓avoiding␈αenormous␈αamounts␈αof␈αrepetitious␈αtyping.␈α 'AL␈αshould␈αhave␈αa␈αgeneral-purpose␈αtext␈αmacro
␈↓ ↓H␈↓system interfaced into the scanner and parser.

␈↓ ↓H␈↓Simultaneous␈α∀execution␈α∀of␈α∀several␈α∀processes␈α∀should␈α∀be␈α∀available.␈α∀A␈α∀general␈α∃mechanism␈α∀for
␈↓ ↓H␈↓simultaneity␈α∂is␈α∂desired,␈α⊂so␈α∂that␈α∂calculation␈α⊂and␈α∂arm␈α∂motion␈α⊂can␈α∂take␈α∂place␈α⊂simultaneously,␈α∂and
␈↓ ↓H␈↓several manipulators can be in independent motion.
␈↓ ↓H␈↓Page 2␈α?␈α?␈α?␈αPHILOSOPHY AND DESIGN GOALS <<REVISED>>␈↓ ≡.0.2



␈↓ ↓H␈↓␈↓β.0.2 MOTION SPECIFICATIONS␈↓

␈↓ ↓H␈↓Experience␈α∞with␈α∞WAVE␈α∞has␈α∞shown␈α∂that␈α∞calculating␈α∞trajectories␈α∞for␈α∞manipulators␈α∞is␈α∂a␈α∞desirable
␈↓ ↓H␈↓feature,␈α⊗although␈α↔a␈α⊗time-consuming␈α↔one.␈α⊗ Therefore,␈α⊗a␈α↔motion␈α⊗should␈α↔be␈α⊗calculated␈α↔in␈α⊗a
␈↓ ↓H␈↓"compilation"␈α∪step,␈α∩and␈α∪executed␈α∪at␈α∩a␈α∪later␈α∪time,␈α∩perhaps␈α∪repeatedly.␈α∪ This␈α∩leads␈α∪to␈α∪a␈α∩clear
␈↓ ↓H␈↓distinction between compile-time and runtime.

␈↓ ↓H␈↓The␈α
user␈α
should␈α
be␈α
able␈α
to␈α
demand␈αthat␈α
a␈α
trajectory␈α
pass␈α
through␈α
given␈α
intermediate␈αpoints.␈α
 The
␈↓ ↓H␈↓primary␈α⊃use␈α⊃of␈α⊂this␈α⊃is␈α⊃to␈α⊂avoid␈α⊃collisions␈α⊃during␈α⊂the␈α⊃motion.␈α⊃ It␈α⊂is␈α⊃also␈α⊃useful␈α⊃for␈α⊂specifying
␈↓ ↓H␈↓complicated motions.

␈↓ ↓H␈↓A␈αwide␈αrange␈αof␈αexceptional␈αconditions␈αcan␈α
occur␈αduring␈αmotion␈αof␈αa␈αmanipulator:␈αexcessive␈α
force
␈↓ ↓H␈↓might␈αbe␈αexerted,␈αa␈αstopping␈αcondition␈αmay␈αbe␈αmet,␈αthe␈αarm␈αmight␈αcome␈αtoo␈αclose␈αto␈αa␈αdangerous
␈↓ ↓H␈↓region,␈αthe␈αuser␈αmay␈αinterrupt␈αthe␈αmotion␈αmanually,␈αsome␈αspecified␈αtime␈αlimit␈αmight␈αbe␈αexceeded.
␈↓ ↓H␈↓Appropriate␈αaction␈α
must␈αbe␈αtaken␈α
as␈αsoon␈αas␈α
any␈αof␈αthese␈α
occurs,␈αfor␈αexample:␈α
to␈αstart␈αup␈α
a␈αnew
␈↓ ↓H␈↓concurrent␈αprocess,␈α
to␈αterminate␈αsomething␈α
already␈αactive,␈α
to␈αnotify␈αthe␈α
user,␈αto␈α
file␈αaway␈αa␈α
statistic
␈↓ ↓H␈↓somewhere␈α
in␈α
a␈αtable.␈α
 Therefore,␈α
'AL␈αmust␈α
allow␈α
the␈α
user␈αflexibility␈α
in␈α
specifying␈αwhat␈α
conditions
␈↓ ↓H␈↓to␈αmonitor␈αduring␈αthe␈αcourse␈αof␈αmotions␈α(and␈αduring␈αexecution␈αof␈αblocks␈αof␈αcode␈αin␈αgeneral),␈αand
␈↓ ↓H␈↓what␈αto␈αdo␈αin␈αthe␈αcase␈αthat␈αa␈αtested␈αcondition␈αoccurs.␈α It␈αis␈αalso␈αuseful␈αto␈αchange␈αthe␈αnature␈αof␈αthe
␈↓ ↓H␈↓test␈αduring␈αa␈αmotion,␈αif␈αdifferent␈αsegments␈αof␈αmotion␈αrequire␈αdifferent␈αtypes␈αof␈αmonitoring.␈α This
␈↓ ↓H␈↓concept␈α∩can␈α∩be␈α∩generalized␈α∪to␈α∩include␈α∩the␈α∩modification␈α∩of␈α∪a␈α∩motion␈α∩during␈α∩its␈α∪execution␈α∩to
␈↓ ↓H␈↓accomodate to changing conditions.

␈↓ ↓H␈↓We␈α
make␈αthe␈α
assumption␈α
that␈αthreshold␈α
tests␈α
suffice␈αfor␈α
assembly␈α
with␈αsensory␈α
feedback.␈α In␈α
many
␈↓ ↓H␈↓cases,␈αthreshold␈αtests␈αdo␈αsuffice:␈αTo␈αtell␈αif␈αthe␈αarm␈αhas␈αhit␈αsomething,␈αa␈αthreshold␈αtest␈αon␈αdirected
␈↓ ↓H␈↓force␈αworks.␈α
To␈αtell␈α
if␈αa␈α
screw␈αis␈α
binding,␈αa␈α
similar␈αtest␈α
serves.␈α It␈α
is,␈αhowever,␈α
quite␈αtrue␈α
that␈αin
␈↓ ↓H␈↓general,␈α∂such␈α∂tests␈α∂lack␈α∂the␈α∂ability␈α∂to␈α∂modify␈α∂trajectories␈α∂based␈α∂on␈α∂the␈α∂strength␈α∂of␈α∂some␈α∞signal.
␈↓ ↓H␈↓This␈αlack␈αis␈αonly␈α
partially␈αfilled␈αby␈αan␈α
ability␈αto␈αdisable␈αand␈α
enable␈αcondition␈αmonitors␈αduring␈α
the
␈↓ ↓H␈↓course␈αof␈α
a␈αmotion.␈α It␈α
is␈αour␈αhope␈α
eventually␈αto␈αinclude␈α
the␈αcapacity␈αfor␈α
including␈αdevices␈αsuch␈α
as
␈↓ ↓H␈↓wrist␈α
force␈αsensors␈α
in␈α
the␈αservo␈α
control␈αloop␈α
in␈α
a␈αprogrammable␈α
fashion.␈α
 Our␈αresearch␈α
has␈αnot␈α
yet
␈↓ ↓H␈↓delved␈α
into␈αthis␈α
fascinating␈αprospect,␈α
and␈αwe␈α
hesitate␈αto␈α
include␈αa␈α
facility␈αin␈α
the␈α
language␈αwhich
␈↓ ↓H␈↓we␈αdo␈αnot␈αunderstand␈αvery␈αwell.␈α When␈αwe␈αhave␈αa␈αfirmer␈αgrip␈αon␈αthe␈αsubject␈α(which␈αincludes␈αthe
␈↓ ↓H␈↓general class of motions of accomodation) we will no doubt modify the language accordingly.



␈↓ ↓H␈↓␈↓β.0.3 THE DATABASE AND ITS USES␈↓

␈↓ ↓H␈↓Since␈α∂locations␈α∞are␈α∂not␈α∂known␈α∞exactly␈α∂during␈α∞planning␈α∂of␈α∂a␈α∞trajectory,␈α∂there␈α∞should␈α∂be␈α∂a␈α∞clear
␈↓ ↓H␈↓distinction␈α∃between␈α∃planned␈α∃values␈α∃and␈α∃runtime␈α∃values.␈α∃ Planned␈α∃values␈α∃will␈α∃be␈α∃used␈α∀for
␈↓ ↓H␈↓trajectory␈α⊂calculation;␈α⊂at␈α⊂runtime,␈α⊂trajectories␈α⊂will␈α⊂be␈α⊂modified␈α⊂if␈α⊂necessary␈α⊂to␈α⊂account␈α⊃for␈α⊂any
␈↓ ↓H␈↓discrepancies.␈α∞The␈α∞planned␈α
values␈α∞are␈α∞therefore␈α
a␈α∞database␈α∞on␈α
which␈α∞trajectory␈α∞calculations␈α
are
␈↓ ↓H␈↓computed. This database will often be referred to as a world model.

␈↓ ↓H␈↓Assembly␈αtasks␈αrequire␈α
that␈αone␈αobject␈α
be␈αaffixed␈αto␈αanother.␈α
 We␈αwish␈αto␈α
model␈αthis␈αby␈αhaving␈α
a
␈↓ ↓H␈↓semantic␈α∩attachment␈α∪between␈α∩objects.␈α∩When␈α∪one␈α∩object␈α∩moves,␈α∪the␈α∩second␈α∩one␈α∪should␈α∩move
␈↓ ↓H␈↓accordingly,␈αthat␈αis,␈αits␈αplanning␈αvalue␈αshould␈αbe␈αproperly␈αmodified.␈αThus,␈αthe␈αworld␈αmodel␈αmust
␈↓ ↓H␈↓also␈αinclude␈αinformation␈αon␈αattachments␈αof␈αobjects,␈αsince␈αplanning␈αvalues␈αwill␈αbe␈αaffected␈αby␈αtheir
␈↓ ↓H␈↓.0.3␈α?␈α?␈α?␈α+PHILOSOPHY AND DESIGN GOALS <<REVISED>>␈↓ 
pPage 3



␈↓ ↓H␈↓existence.␈α The␈αattachment␈αconcept␈αcarries␈αover␈αto␈αthe␈αruntime␈αsystem,␈αwhich␈αdoes␈α
the␈αequivalent
␈↓ ↓H␈↓modifications␈α∀of␈α∃the␈α∀actual␈α∀values.␈α∃ This␈α∀saves␈α∀the␈α∃user␈α∀untold␈α∀bookkeeping␈α∃operations␈α∀to
␈↓ ↓H␈↓determine where an object is after its base has been moved.

␈↓ ↓H␈↓The␈α
compiler␈α
should␈α
be␈α
able␈α
to␈α
maintain␈αa␈α
wide␈α
variety␈α
of␈α
information␈α
about␈α
expected␈αruntime
␈↓ ↓H␈↓states.␈α⊂ This␈α⊂includes␈α⊂not␈α⊂only␈α⊂object␈α⊂attachments␈α⊂and␈α⊂variable␈α⊂planning␈α⊂values,␈α⊂as␈α∂previously
␈↓ ↓H␈↓mentioned,␈αbut␈α
also␈αinformation␈α
like␈αthe␈αaccuracy␈α
within␈αwhich␈α
the␈αplanning␈α
value␈αis␈αknown,␈α
how
␈↓ ↓H␈↓heavy␈αan␈αobject␈α
is,␈αhow␈αmany␈α
faces␈αit␈αhas␈α
on␈αwhich␈αit␈αcan␈α
rest,␈αhow␈αwide␈α
the␈αfingers␈αof␈α
an␈αarm
␈↓ ↓H␈↓should␈α⊂open␈α⊂to␈α⊂grasp␈α⊂it.␈α⊂ This␈α⊃information␈α⊂may␈α⊂come␈α⊂from␈α⊂several␈α⊂sources,␈α⊃including␈α⊂explicit
␈↓ ↓H␈↓assertions␈α⊂by␈α⊂the␈α⊂user,␈α⊂the␈α⊂output␈α∂of␈α⊂computer-aided␈α⊂design␈α⊂programs,␈α⊂and␈α⊂built-in␈α∂knowledge
␈↓ ↓H␈↓about the system hardware.

␈↓ ↓H␈↓'AL␈α∞should␈α∞provide␈α∞a␈α∞number␈α∞of␈α∞explicit␈α∞mechanisms␈α∞for␈α∞using␈α∞this␈α∞information,␈α∞ranging␈α∞from
␈↓ ↓H␈↓simple␈α∩retrieval␈α∪of␈α∩data␈α∩from␈α∪the␈α∩compile-time␈α∩model␈α∪to␈α∩conditional␈α∩compilation␈α∪facilities␈α∩to
␈↓ ↓H␈↓produce␈α∂substantially␈α∞different␈α∂object␈α∂programs,␈α∞depending␈α∂on␈α∞the␈α∂planning␈α∂information.␈α∞ Such
␈↓ ↓H␈↓facilities␈α⊂allow␈α∂the␈α⊂user␈α∂to␈α⊂write␈α∂a␈α⊂single␈α∂piece␈α⊂of␈α∂code␈α⊂in␈α∂some␈α⊂generality,␈α∂while␈α⊂avoiding␈α∂the
␈↓ ↓H␈↓inefficiencies␈α∞of␈α
many␈α∞needless␈α∞runtime␈α
checks␈α∞and␈α
the␈α∞planning␈α∞of␈α
useless␈α∞trajectories␈α∞for␈α
cases
␈↓ ↓H␈↓that will never be executed.

␈↓ ↓H␈↓The␈α∞system␈α∞should␈α∞have␈α∞enough␈α∞domain-specific␈α∞knowledge␈α∞to␈α∞allow␈α∞programs␈α∞to␈α∞be␈α∂written␈α∞in
␈↓ ↓H␈↓terms␈α⊂of␈α⊃common␈α⊂assembly␈α⊃operations,␈α⊂rather␈α⊃than␈α⊂exclusively␈α⊃in␈α⊂terms␈α⊃of␈α⊂the␈α⊃detailed␈α⊂single
␈↓ ↓H␈↓motions.␈α
 At␈α
the␈αsimplest␈α
level,␈α
this␈α
involves␈αprovision␈α
of␈α
a␈αlibrary␈α
of␈α
common␈α
assembly␈α"macro-
␈↓ ↓H␈↓operations"␈α
that␈α
can␈α
be␈α
conditionally␈α∞expanded␈α
to␈α
perform␈α
particular␈α
subtasks.␈α
 Beyond␈α∞this,␈α
we
␈↓ ↓H␈↓would␈αlike␈αan␈αinteractive␈αsystem␈αthat␈αcan␈αtake␈αa␈α"high␈αlevel"␈αdescription␈αof␈αan␈αassembly␈αalgorithm
␈↓ ↓H␈↓and␈α∞fill␈α∞in␈α
many␈α∞of␈α∞the␈α∞detailed␈α
decisions␈α∞required␈α∞to␈α∞produce␈α
a␈α∞consistent␈α∞and␈α∞efficient␈α
output
␈↓ ↓H␈↓program.

␈↓ ↓H␈↓The␈α∞range␈α
of␈α∞decisions␈α∞required␈α
to␈α∞convert␈α
from␈α∞a␈α∞high␈α
level␈α∞description␈α
to␈α∞an␈α∞efficient␈α
output
␈↓ ↓H␈↓program␈αis␈αquite␈αbroad,␈αand␈αmany␈αof␈αthe␈αprocesses␈αinvolved␈αcannot␈αbe␈αmodelled␈αreadily␈αin␈αterms
␈↓ ↓H␈↓of␈αthe␈αpurely␈αlocal␈αmechanisms␈αused␈αin␈αexpanding␈αlibrary␈αroutines.␈α For␈αinstance,␈αa␈αcommand␈αlike
␈↓ ↓H␈↓"put␈α
the␈α
engine␈α
block␈α
on␈α
the␈α
table␈α
in␈α
an␈α
upright␈α
position"␈α
would␈α
require␈α
the␈α
system␈α
to␈αexamine
␈↓ ↓H␈↓future␈α⊃operations␈α⊃on␈α⊃the␈α⊂engine␈α⊃block␈α⊃to␈α⊃select␈α⊃the␈α⊂exact␈α⊃orientation␈α⊃to␈α⊃use.␈α⊃ Similarly,␈α⊂many
␈↓ ↓H␈↓operations␈α∩produce␈α∩side␈α∩effects␈α∩that␈α∩make␈α∩other␈α∩tasks␈α∩either␈α∩easier␈α∩or␈α∩harder.␈α∪ For␈α∩instance,
␈↓ ↓H␈↓inserting␈α
a␈αpin␈α
into␈α
a␈αhole␈α
yields␈α
information␈αabout␈α
the␈α
exact␈αlocation␈α
of␈α
the␈αhole␈α
and␈αtherefore␈α
of
␈↓ ↓H␈↓the␈α
object␈αinto␈α
which␈α
the␈αhole␈α
has␈α
been␈αdrilled.␈α
 If␈αthere␈α
are␈α
a␈αnumber␈α
of␈α
pins␈αto␈α
be␈αinserted,␈α
then
␈↓ ↓H␈↓it␈α⊂may␈α⊃be␈α⊂a␈α⊂good␈α⊃idea␈α⊂to␈α⊂insert␈α⊃pins␈α⊂into␈α⊂the␈α⊃easier-to-locate␈α⊂holes␈α⊂first␈α⊃and␈α⊂then␈α⊂to␈α⊃use␈α⊂the
␈↓ ↓H␈↓information␈α∩so␈α∩gained␈α∪to␈α∩help␈α∩with␈α∪the␈α∩remaining␈α∩insertions.␈α∩(On␈α∪the␈α∩other␈α∩hand,␈α∪such␈α∩an
␈↓ ↓H␈↓ordering␈α∞may␈α∞very␈α∞well␈α∞make␈α∞the␈α∞actual␈α∞insertions␈α∞more␈α∞difficult␈α∞because␈α∞of␈α∞obstructions␈α∞to␈α
the
␈↓ ↓H␈↓hand).␈αThe␈αsystem␈αshould␈αbe␈αable␈αto␈αuse␈αthese␈αsorts␈αof␈αconsiderations␈αas␈αit␈αgoes␈αabout␈αgenerating
␈↓ ↓H␈↓the output program.

␈↓ ↓H␈↓A␈αuser␈αshould␈αbe␈αable␈αto␈αspecify␈αdifferent␈α
parts␈αof␈αa␈αtask␈αat␈αvarious␈αlevels␈αof␈αdetail.␈α
 The␈αsystem
␈↓ ↓H␈↓must␈α∩be␈α∪able␈α∩to␈α∪accept␈α∩explicit␈α∪advice␈α∩telling␈α∪exactly␈α∩how␈α∪some␈α∩particular␈α∪subtask␈α∩is␈α∪to␈α∩be
␈↓ ↓H␈↓accomplished␈α∞and␈α∞then␈α∞complete␈α∞the␈α∞program␈α∞in␈α
a␈α∞way␈α∞that␈α∞does␈α∞not␈α∞conflict␈α∞with␈α∞those␈α
things
␈↓ ↓H␈↓that␈αhave␈αbeen␈αexplicitly␈α
specified.␈α This␈αis␈αespecially␈αimportant␈α
for␈αearly␈αversions␈αof␈α
'AL,␈αwhich
␈↓ ↓H␈↓are not likely to be very "smart" and will therefore require a fair amount of explicit help.

␈↓ ↓H␈↓The␈α
user␈αshould␈α
be␈αable␈α
to␈α
describe␈αthe␈α
"intent"␈αof␈α
a␈αparticular␈α
piece␈α
of␈αcode,␈α
at␈αleast␈α
to␈αthe␈α
extent
␈↓ ↓H␈↓Page 4␈α?␈α?␈α?␈αPHILOSOPHY AND DESIGN GOALS <<REVISED>>␈↓ ≡.0.3



␈↓ ↓H␈↓of␈α⊃specifying␈α⊂any␈α⊃(non-obvious)␈α⊃prerequisites␈α⊂or␈α⊃updates␈α⊂to␈α⊃the␈α⊃world␈α⊂model.␈α⊃ This␈α⊃facility␈α⊂is
␈↓ ↓H␈↓especially␈α⊂important␈α⊂for␈α⊃programs␈α⊂that␈α⊂mix␈α⊂both␈α⊃high␈α⊂and␈α⊂low-level␈α⊂primitives.␈α⊃Similarly,␈α⊂the
␈↓ ↓H␈↓system␈α⊂should␈α⊂be␈α⊂able␈α⊂to␈α⊂show␈α⊂the␈α⊂user␈α⊂how␈α⊂it␈α⊂is␈α⊂filling␈α⊂in␈α⊂the␈α⊂details␈α⊂to␈α⊂produce␈α⊂an␈α∂output
␈↓ ↓H␈↓program,␈αand␈αwhy.␈αThis␈αis␈α
very␈αimportant␈αboth␈αfor␈αdebugging␈α
and␈αfor␈αexplaining␈αto␈αthe␈αuser␈α
any
␈↓ ↓H␈↓requests for advice that it must make.



␈↓ ↓H␈↓␈↓β.0.4 THE RUNTIME SYSTEM␈↓

␈↓ ↓H␈↓The␈αcalculation␈αof␈αtrajectories␈αis␈αtime-consuming␈αbut␈αnot␈αtime-critical;␈αservoing␈αof␈αdevices␈αis␈αtime-
␈↓ ↓H␈↓critical␈αbut␈αnot␈αespecially␈αtime-consuming.␈α 'AL␈αis␈αdesigned␈αfor␈αuse␈αin␈αa␈αfactory␈αenvironment,␈αwith
␈↓ ↓H␈↓repetitive␈α
execution␈α
of␈α
plans␈α
at␈α
many␈α
work␈αstations.␈α
 These␈α
two␈α
considerations␈α
lead␈α
us␈α
to␈αthe␈α
belief
␈↓ ↓H␈↓that␈αall␈αplanning␈αshould␈αoccur␈αon␈αa␈αlarge␈αtime-shared␈αcomputer,␈αthe␈α"maxi"␈α(for␈αexample,␈αa␈αPDP-
␈↓ ↓H␈↓10),␈α
whereas␈α∞execution␈α
should␈α∞take␈α
place␈α∞under␈α
the␈α∞control␈α
of␈α∞a␈α
small␈α∞computer,␈α
the␈α∞"mini"␈α
(for
␈↓ ↓H␈↓example,␈α∞a␈α∞PDP-11),␈α∞many␈α∞of␈α∞which␈α∞could␈α∂be␈α∞distributed␈α∞in␈α∞the␈α∞work␈α∞area.␈α∞ The␈α∞maxi␈α∂will␈α∞be
␈↓ ↓H␈↓called␈αupon␈α
to␈αdo␈α
all␈αplanning,␈α
but␈αcan␈αalso␈α
be␈αused␈α
for␈αany␈α
other␈αsort␈α
of␈αcomputing␈α(for␈α
example,
␈↓ ↓H␈↓inventory␈α
work␈α
or␈α
payroll␈α
calculation);␈α
only␈α
one␈α
such␈α
machine␈α
would␈α
be␈α
necessary␈α
for␈α∞the␈α
entire
␈↓ ↓H␈↓factory.␈α⊂ Each␈α⊂work␈α⊂station␈α∂would␈α⊂have␈α⊂its␈α⊂own␈α∂relatively␈α⊂inexpensive␈α⊂mini␈α⊂(and␈α⊂simple␈α∂work
␈↓ ↓H␈↓stations␈α∀might␈α∀share␈α∪minis).␈α∀ It␈α∀is␈α∪not␈α∀necessary␈α∀that␈α∪the␈α∀minis␈α∀be␈α∪connected␈α∀to␈α∀the␈α∪maxi;
␈↓ ↓H␈↓communication␈αbetween␈αthem␈α
could␈αbe␈αthrough␈αdisk␈α
or␈αpaper␈αtape.␈α It␈α
is␈αeven␈αconceivable␈αthat␈α
all
␈↓ ↓H␈↓of 'AL could reside on a mini, but our present implementation will not do this.

␈↓ ↓H␈↓The␈α_runtime␈α→system␈α_must␈α→support␈α_simultaneous␈α_executions␈α→of␈α_several␈α→processes.␈α_ Several
␈↓ ↓H␈↓manipulators␈α
might␈αbe␈α
running␈αsimultaneously,␈α
each␈αmotor␈α
of␈αwhich␈α
requires␈αa␈α
separate␈αprocess;
␈↓ ↓H␈↓several␈α∂condition␈α∞monitors␈α∂might␈α∞be␈α∂active;␈α∞several␈α∂code␈α∞segments␈α∂(doing,␈α∂perhaps,␈α∞calculations)
␈↓ ↓H␈↓might␈α
be␈α
simultaneously␈α
active.␈α
 Those␈α∞processes␈α
which␈α
are␈α
dealing␈α
with␈α
real-time␈α∞devices␈α
(joint
␈↓ ↓H␈↓servos␈α∞and␈α
condition␈α∞checkers)␈α
must␈α∞be␈α∞guaranteed␈α
service␈α∞at␈α
regular␈α∞intervals;␈α∞the␈α
computation
␈↓ ↓H␈↓processes␈α∃can␈α∀fill␈α∃in␈α∀any␈α∃time␈α∀gaps.␈α∃ Thus,␈α∀the␈α∃runtime␈α∀system␈α∃must␈α∀include␈α∃some␈α∀simple
␈↓ ↓H␈↓implementation of multiple processes under real-time constraints.

␈↓ ↓H␈↓Trajectories␈αare␈αcalculated␈αby␈αthe␈αcompiler␈αon␈αthe␈αbasis␈αof␈αincomplete␈αinformation.␈α At␈αruntime,␈αit
␈↓ ↓H␈↓is␈αnecessary␈αto␈αmodify␈αthose␈αplans␈αto␈αfit␈αthem␈αto␈αthe␈αsomewhat␈αdifferent␈αactual␈αlocation␈αof␈αobjects.
␈↓ ↓H␈↓That␈α∂means␈α∂that␈α∞certain␈α∂information␈α∂must␈α∞be␈α∂carried␈α∂at␈α∞runtime,␈α∂specifically␈α∂the␈α∂locations␈α∞that
␈↓ ↓H␈↓each␈αtrajectory␈αis␈αdesired␈αto␈αpass␈αthrough,␈αthe␈αlocations␈αof␈αall␈αobjects,␈αand␈αhow␈αthey␈α
are␈αattached
␈↓ ↓H␈↓together.

␈↓ ↓H␈↓The␈α
system␈α
must␈α
be␈α
capable␈α
of␈α
using␈α
vision␈α
and␈α
other␈α
yet␈α
unpredictable␈α
forms␈α
of␈α
feedback.␈α
Vision
␈↓ ↓H␈↓would␈α∪be␈α∪quite␈α∩useful␈α∪in␈α∪searching␈α∪for␈α∩objects␈α∪and␈α∪testing␈α∪for␈α∩adequacy␈α∪of␈α∪assembly.␈α∪It␈α∩is
␈↓ ↓H␈↓conceivable␈α
that␈α
vision␈α
will␈α
be␈αused␈α
for␈α
the␈α
servoing␈α
of␈α
an␈αarm;␈α
this␈α
implies␈α
that␈α
vision␈α
must␈αbe␈α
in
␈↓ ↓H␈↓the␈αfeedback␈αloop␈αduring␈αmotions␈αOther␈αdynamic␈αfeedback␈α(like␈αforce-sensing␈αwrists)␈α
could␈αmake
␈↓ ↓H␈↓the␈α
capabilities␈α
of␈α
the␈α
arms␈α
much␈α
greater␈α∞in␈α
dealing␈α
with␈α
non-rigid␈α
materials␈α
like␈α
cloth␈α∞or␈α
rope.
␈↓ ↓H␈↓What␈αis␈αneeded␈αis␈αa␈αway␈αof␈αspecifying␈αcalls␈αto␈αthese␈α"external"␈αdevices␈αso␈αthat␈αwhen␈αthey␈αbecome
␈↓ ↓H␈↓available, they can be meshed into the system without much difficulty.

␈↓ ↓H␈↓The␈α∞range␈α∞of␈α∞conceivable␈α∞tasks␈α∞is␈α∞large␈α
enough␈α∞that␈α∞pure␈α∞hardware␈α∞servoing␈α∞cannot␈α∞in␈α
general
␈↓ ↓H␈↓suffice.␈α
 The␈αreason␈α
for␈αthis␈α
is␈α
that␈αhardware␈α
servoing␈αrestricts␈α
use␈α
to␈αone␈α
of␈αa␈α
small␈α
number␈αof
␈↓ ↓H␈↓servo␈α⊗modes␈α⊗(typically␈α↔position,␈α⊗velocity,␈α⊗or␈α↔force),␈α⊗and␈α⊗has␈α↔no␈α⊗provision␈α⊗for␈α↔motions␈α⊗of
␈↓ ↓H␈↓.0.4␈α?␈α?␈α?␈α+PHILOSOPHY AND DESIGN GOALS <<REVISED>>␈↓ 
pPage 5



␈↓ ↓H␈↓accomodation␈α∀or␈α∃motions␈α∀whose␈α∃modes␈α∀might␈α∀change␈α∃in␈α∀midstream␈α∃due␈α∀to␈α∃some␈α∀software-
␈↓ ↓H␈↓detectable␈α
condition.␈α
 Pure␈α
hardware␈α
servoing␈α
could␈α∞not␈α
be␈α
readily␈α
modified␈α
to␈α
account␈α∞for␈α
new
␈↓ ↓H␈↓feedback␈α⊃devices␈α⊃or␈α⊃methods.␈α⊃ A␈α⊃philosophy␈α⊃of␈α⊃software␈α⊃servoing␈α⊃has␈α⊃these␈α⊃advantages:␈α⊃It␈α⊂is
␈↓ ↓H␈↓possible␈α∞to␈α∞program␈α∞the␈α∂manner␈α∞in␈α∞which␈α∞feedback␈α∂is␈α∞to␈α∞be␈α∞used.␈α∂ It␈α∞is␈α∞easier␈α∞to␈α∂interface␈α∞new
␈↓ ↓H␈↓types␈α
of␈α
sensors.␈α
 It␈α
is␈α
possible␈α
to␈α
modify␈α
the␈αservo␈α
while␈α
the␈α
arm␈α
is␈α
in␈α
motion.␈α
 It␈α
is␈α
possible␈αto
␈↓ ↓H␈↓supply␈α
the␈α
driving␈α
program␈α
with␈α
information␈α
concerning␈αthe␈α
success␈α
of␈α
the␈α
motion␈α
as␈α
well␈α
as␈αto
␈↓ ↓H␈↓keep␈α
it␈α
up-to-date␈α
on␈α
the␈α
arm␈α
status.␈α
 Some␈α
clearly␈α
distinguishable␈α
modes␈α
of␈α
servoing␈α
that␈αcould␈α
be
␈↓ ↓H␈↓translated␈αinto␈α
hardware,␈αhowever␈α
the␈αhardware␈α
becomes␈αcomplicated␈α
as␈αthe␈α
computer␈αneeds␈αto␈α
be
␈↓ ↓H␈↓able␈α∞to␈α∂switch␈α∞modes␈α∂as␈α∞the␈α∂program␈α∞is␈α∞being␈α∂executed.␈α∞There␈α∂is␈α∞not␈α∂much␈α∞saving␈α∂in␈α∞compute
␈↓ ↓H␈↓power␈α
since␈α
the␈α
computer␈α
needs␈α
to␈α
perform␈α
a␈α
servo␈α
calculation␈α
in␈α
order␈α
to␈α
understand␈α
what␈α
the
␈↓ ↓H␈↓manipulator is doing and to interact with the task.



␈↓ ↓H␈↓␈↓β.0.5 PROGRAMMING AIDS␈↓

␈↓ ↓H␈↓A␈αuser␈αshould␈αbe␈αable␈αto␈αwrite␈αa␈αpiece␈αof␈αcode,␈αtry␈αit␈αon␈αthe␈αspot,␈αand␈αdelete␈αor␈αreplace␈αsections␈αof
␈↓ ↓H␈↓previous code.

␈↓ ↓H␈↓The␈αcompiler␈α
should␈αmake␈αa␈α
great␈αnumber␈αof␈α
semantic␈αchecks,␈αsuch␈α
as␈αassuring␈αthat␈α
a␈αproposed
␈↓ ↓H␈↓motion␈α⊂will␈α⊂not␈α⊂hit␈α⊂some␈α⊂object␈α⊂(although␈α⊂this␈α∂is␈α⊂a␈α⊂difficult␈α⊂problem␈α⊂which␈α⊂has␈α⊂not␈α⊂yet␈α∂been
␈↓ ↓H␈↓satisfactorily␈α∂solved)␈α∞or␈α∂that␈α∞simultaneous␈α∂independent␈α∂motions␈α∞are␈α∂not␈α∞being␈α∂requested␈α∂for␈α∞the
␈↓ ↓H␈↓same device.

␈↓ ↓H␈↓Error␈α∩recovery␈α∪facilities␈α∩are␈α∩very␈α∪important.␈α∩ A␈α∩user␈α∪should␈α∩be␈α∩able␈α∪to␈α∩recover␈α∪from␈α∩errors
␈↓ ↓H␈↓discovered␈α∂during␈α⊂any␈α∂phase␈α∂of␈α⊂debugging.␈α∂ Similarly,␈α∂production␈α⊂programs␈α∂should␈α∂be␈α⊂able␈α∂to
␈↓ ↓H␈↓request␈α∞operator␈α∞intervention␈α∞where␈α∞necessary␈α∞and␈α∞should␈α
(at␈α∞least)␈α∞be␈α∞able␈α∞to␈α∞be␈α∞restarted␈α∞at␈α
a
␈↓ ↓H␈↓convenient place after the problem is fixed.

␈↓ ↓H␈↓The␈α∩user␈α∩should␈α⊃be␈α∩given␈α∩a␈α⊃wide␈α∩choice␈α∩of␈α⊃media␈α∩for␈α∩communication␈α⊃with␈α∩the␈α∩system.␈α⊃For
␈↓ ↓H␈↓instance,␈αstatus␈αinformation␈αfrom␈αthe␈αarms␈αand␈αother␈αruntime␈αdevices␈αshould␈αbe␈αavailable␈αduring
␈↓ ↓H␈↓the␈αcoding␈αprocess␈αitself␈αfor␈αthe␈αpurpose␈αof␈αsetting␈αconstants␈αand␈αfor␈αimplementation␈α
of␈α"learning
␈↓ ↓H␈↓by␈α∩showing"␈α∩techniques.␈α∩ Similarly,␈α∩full␈α∩use␈α∩should␈α∩be␈α∩made␈α∩of␈α∩available␈α∪computer␈α∩graphics
␈↓ ↓H␈↓hardware,␈αboth␈αas␈αa␈αmeans␈αfor␈αdepicting␈αthe␈αcompiler's␈αplanning␈αmodel␈αof␈αvarious␈αruntime␈αstates
␈↓ ↓H␈↓and as another means of non-verbal input.

␈↓ ↓H␈↓There␈αshould␈αbe␈αa␈αway␈α
to␈αinvestigate␈αthe␈αcontents␈αof␈α
the␈αruntime␈αsystem,␈αboth␈αvariables␈αand␈α
code,
␈↓ ↓H␈↓in␈αorder␈αto␈αpatch␈αsimple␈αmistakes␈αdiscovered␈α
during␈αthe␈αcourse␈αof␈αa␈αproduction␈αrun.␈α This␈α
feature
␈↓ ↓H␈↓will be especially useful for debugging the compiler.
␈↓ ↓H␈↓Page 6␈α?␈α?␈α?␈α?␈α?␈α%GENERAL SYSTEM OUTLINE␈↓ 3.1



␈↓ ↓H␈↓␈↓∧.1 GENERAL SYSTEM OUTLINE␈↓



␈↓ ↓H␈↓␈↓β.1.1 HARDWARE␈↓

␈↓ ↓H␈↓Currently␈α⊃two␈α⊂Stanford␈α⊃Electric␈α⊂Arms,␈α⊃built␈α⊂by␈α⊃Victor␈α⊂Scheinman␈α⊃[Scheinman],␈α⊃are␈α⊂available.
␈↓ ↓H␈↓They␈αare␈αcalled␈αYELLOW␈αand␈αBLUE.␈α Each␈αhas␈αsix␈αjoints␈αand␈αa␈αhand␈αthat␈αcan␈αopen␈αand␈αclose.
␈↓ ↓H␈↓The␈α
joints␈α∞are␈α
controlled␈α
by␈α∞electric␈α
motors;␈α
each␈α∞joint␈α
has␈α
both␈α∞position␈α
and␈α∞velocity␈α
feedback.
␈↓ ↓H␈↓Motor␈α∞drives␈α∞are␈α∞sent␈α∂from␈α∞the␈α∞computer␈α∞to␈α∞the␈α∂arm␈α∞via␈α∞a␈α∞digital-to-analog␈α∂converter␈α∞(D-to-A);
␈↓ ↓H␈↓feedback signals are routed through an analog-to-digital converter (A-to-D) back to the computer.

␈↓ ↓H␈↓There␈α∂are␈α∂two␈α∂computer-controlled␈α∂cameras.␈α∂The␈α∂computer␈α∂can␈α∂control␈α∂the␈α∂pan,␈α∂tilt,␈α∂focus,␈α∞iris,
␈↓ ↓H␈↓filter, and zoom (or lens turret) on each camera.

␈↓ ↓H␈↓Various␈α
others␈α
devices␈α
are␈α
designed␈α
and␈α
implemented␈αas␈α
needed.␈α
 We␈α
use␈α
tools,␈α
jigs␈α
and␈αspecial
␈↓ ↓H␈↓markings␈αfor␈αseveral␈αpurposes:␈αto␈αrender␈αa␈αtask␈α
possible␈α(an␈αexample␈αis␈αthe␈αarm␈αitself),␈αto␈α
improve
␈↓ ↓H␈↓efficiency␈α⊂(the␈α⊂mechanical␈α⊂screwdriver),␈α⊂and␈α⊂to␈α⊂overcome␈α⊂some␈α⊂of␈α⊂our␈α⊂sensory␈α⊂and␈α∂mechanical
␈↓ ↓H␈↓limitations␈α∀(the␈α∀screw␈α∀dispenser).␈α∀ Currently␈α∪we␈α∀have␈α∀an␈α∀electrically␈α∀powered␈α∀screwdriver,␈α∪a
␈↓ ↓H␈↓pneumatic␈αvise,␈αand␈αan␈αelectrically␈αcontrolled␈αturntable.␈α The␈αscrewdriver␈αcan␈αbe␈αpicked␈αup␈αby␈αan
␈↓ ↓H␈↓arm␈α
and␈αoperates␈α
in␈α
either␈αdirection␈α
over␈α
a␈αrange␈α
of␈α
speeds.␈α The␈α
vise␈α
can␈αbe␈α
opened␈α
or␈αclosed;
␈↓ ↓H␈↓soon␈α⊂there␈α⊂will␈α⊃be␈α⊂a␈α⊂way␈α⊃to␈α⊂servo␈α⊂it␈α⊂to␈α⊃a␈α⊂specified␈α⊂opening.␈α⊃ The␈α⊂computer␈α⊂can␈α⊃position␈α⊂the
␈↓ ↓H␈↓turntable␈αto␈αany␈αrotation␈α(within␈α.5␈αdegrees).␈α As␈αsuch␈αdevices␈αare␈αbuilt,␈αthey␈αwill␈αbe␈αinterfaced␈αto
␈↓ ↓H␈↓the␈α
A-to-D,␈α
the␈α
servo␈α
told␈α
how␈α
to␈α∞control␈α
them,␈α
and␈α
the␈α
language␈α
extended␈α
to␈α
include␈α∞syntax␈α
to
␈↓ ↓H␈↓describe how to use them.

␈↓ ↓H␈↓'AL␈αresides␈αon␈αtwo␈αcomputers:␈αThe␈αPDP-10␈αfor␈αall␈αplanning,␈αand␈αa␈αPDP-11/45␈αfor␈α
the␈αexecution
␈↓ ↓H␈↓of␈αthe␈αplans.␈α The␈αformer␈αis␈αrun␈α
as␈αa␈αtimesharing␈αcomputer␈α(under␈αa␈αmodified␈αDEC␈α
system);␈αthe
␈↓ ↓H␈↓latter␈αis␈αoperated␈αin␈αa␈αstand-alone␈αmode␈α
under␈αthe␈α'AL␈αruntime␈αsystem.␈α Each␈αcomputer␈αis␈α
capable
␈↓ ↓H␈↓of␈α
generating␈α∞an␈α
interrupt␈α
in␈α∞the␈α
other,␈α
and␈α∞the␈α
PDP-10␈α
has␈α∞complete␈α
control␈α
over␈α∞the␈α
PDP-11
␈↓ ↓H␈↓console␈αand␈αunibus.␈α
 It␈αis␈αnot␈α
certain␈αexactly␈αwhat␈α
the␈αminimum␈αruntime␈α
computer␈αconfiguration
␈↓ ↓H␈↓will␈αbe;␈α
we␈αuse␈α
floating␈αpoint␈αand␈α
memory␈αmanagement,␈α
but␈αit␈αis␈α
not␈αclear␈α
that␈αthis␈α
is␈αaltogether
␈↓ ↓H␈↓necessary.



␈↓ ↓H␈↓␈↓β.1.2 SOFTWARE␈↓

␈↓ ↓H␈↓See Figure .1 for a picture of the system.

␈↓ ↓H␈↓The␈α⊂SUPERVISOR␈α⊂is␈α⊂the␈α⊂top␈α⊂level␈α⊂of␈α⊂'AL.␈α⊂ It␈α⊂runs␈α⊂on␈α⊂the␈α⊂maxi␈α⊂and␈α⊂provides␈α⊂an␈α∂interface
␈↓ ↓H␈↓between␈α∪the␈α∪user␈α∪and␈α∪the␈α∪other␈α∪parts␈α∪of␈α∪the␈α∪system:␈α∪1)␈α∪listening␈α∪to␈α∪the␈α∪user's␈α∪console␈α∪and
␈↓ ↓H␈↓interpreting␈α⊃input␈α⊃in␈α⊃a␈α⊂simple␈α⊃command␈α⊃language;␈α⊃2)␈α⊂controling␈α⊃the␈α⊃compiler,␈α⊃starting␈α⊃it␈α⊂and
␈↓ ↓H␈↓relaying␈αits␈αerror␈αmessages␈αback␈αto␈αthe␈αuser;␈α
3)␈αsignalling␈αthe␈αloader␈αwhen␈αit␈αis␈αnecessary␈α
to␈αplace
␈↓ ↓H␈↓compiled␈αcode␈αinto␈αthe␈α
mini;␈α4)␈αhandling␈αthe␈α
runtime␈αinterface␈αto␈αthe␈α
mini.␈αEach␈αof␈αthese␈α
modules
␈↓ ↓H␈↓is discussed below.

␈↓ ↓H␈↓The␈α∩USER␈α⊃sits␈α∩at␈α⊃a␈α∩console␈α⊃and␈α∩makes␈α⊃requests␈α∩of␈α⊃'AL.␈α∩ These␈α⊃fall␈α∩into␈α∩several␈α⊃categories:
␈↓ ↓H␈↓.1.2␈α?␈α?␈α?␈α?␈α?␈α?␈αεGENERAL SYSTEM OUTLINE␈↓ 
pPage 7



␈↓ ↓H␈↓Compilation,␈αloading,␈αexecution␈αof␈αprograms,␈αdebugging␈αof␈αcode,␈αrequesting␈αof␈αstatus␈αinformation,
␈↓ ↓H␈↓asking␈α⊂for␈α⊂immediate␈α⊂arm␈α⊂motion,␈α⊂saving␈α⊂and␈α⊂restoring␈α⊂the␈α⊂state␈α⊂of␈α⊂the␈α⊂world␈α⊂at␈α⊂safe␈α⊂points,
␈↓ ↓H␈↓requesting␈α
explanation␈α
of␈αcertain␈α
compiler␈α
decisions.␈αThere␈α
are␈α
actually␈αtwo␈α
different␈α
consoles␈αat
␈↓ ↓H␈↓which␈αa␈αuser␈αcan␈αsit:␈αone␈αis␈αconnected␈αto␈αthe␈αmaxi,␈αthrough␈αwhich␈αhe␈αcan␈αspeak␈αto␈αthe␈αsupervisor
␈↓ ↓H␈↓and␈αall␈αthe␈αparts␈αof␈α'AL␈αresiding␈αon␈αthe␈αmaxi;␈αthe␈αother␈αis␈αconnected␈αto␈αthe␈αmini,␈αand␈αthrough␈αit
␈↓ ↓H␈↓the user can investigate the runtime system and cause modifications.

␈↓ ↓H␈↓The␈α
COMPILER␈αreads␈α
'AL␈α
programs␈αfrom␈α
files␈α(or,␈α
optionally,␈α
directly␈αfrom␈α
the␈α
user's␈αconsole)
␈↓ ↓H␈↓and␈α∩produces␈α⊃load␈α∩modules.␈α∩ The␈α⊃compiler␈α∩is␈α⊃divided␈α∩into␈α∩three␈α⊃phases:␈α∩The␈α∩PARSER,␈α⊃the
␈↓ ↓H␈↓EXPANDER,␈α
and␈αthe␈α
TRAJECTORY␈αCALCULATOR.␈α
The␈αcompiler␈α
is␈αdiscussed␈α
in␈α
detail␈αin
␈↓ ↓H␈↓Section .

␈↓ ↓H␈↓The␈αLOADER␈αtakes␈αthe␈αload␈αmodules␈αprepared␈αby␈αthe␈αcompiler␈αand␈αenters␈αthem␈αinto␈αthe␈αmini's
␈↓ ↓H␈↓runtime␈αsystem.␈α Address␈αrelocation␈αand␈αlinking␈αare␈αdone␈αat␈αthis␈αtime.␈αThe␈αloader␈αalso␈αsets␈αup␈αthe
␈↓ ↓H␈↓data␈α∩area␈α⊃in␈α∩the␈α⊃runtime␈α∩interface␈α⊃in␈α∩the␈α⊃maxi;␈α∩this␈α⊃data␈α∩includes␈α⊃output␈α∩strings,␈α⊃procedure
␈↓ ↓H␈↓linkages,␈α⊂and␈α⊂information␈α∂necessary␈α⊂for␈α⊂diagnostic␈α⊂purposes␈α∂during␈α⊂runtime.␈α⊂ Loading␈α⊂is␈α∂often
␈↓ ↓H␈↓done in a partially incremental fashion, installing new code following previously loaded code.

␈↓ ↓H␈↓The␈α∞RUNTIME␈α∂INTERFACE,␈α∞which␈α∂resides␈α∞in␈α∂the␈α∞maxi,␈α∂is␈α∞charged␈α∂with␈α∞initiating␈α∂the␈α∞mini
␈↓ ↓H␈↓program,␈αfielding␈αprocedure␈αcalls␈αfrom␈αthe␈αrunning␈αprogram␈αto␈αmaxi␈αprocedures,␈αreturning␈α
values
␈↓ ↓H␈↓from␈αthese␈αprocedures,␈αand␈αfetching␈αvalues␈αfrom␈αthe␈αmini␈αfor␈αdebugging␈αpurposes.␈α The␈αinterface
␈↓ ↓H␈↓has␈αthe␈αpower␈αto␈αinterrupt␈αthe␈αexecution␈αof␈αthe␈αprogram␈αand␈αto␈αmodify␈αthe␈αstatus␈αof␈αthe␈αruntime
␈↓ ↓H␈↓system,␈α∀for␈α∀example,␈α∀by␈α∪patching␈α∀in␈α∀additional␈α∀program,␈α∪or␈α∀modifying␈α∀the␈α∀values␈α∀of␈α∪some
␈↓ ↓H␈↓variables.  This allows the user to control the program through the timesharing maxi.

␈↓ ↓H␈↓The␈αRUNTIME␈αSYSTEM␈αis␈αthe␈αset␈αof␈αprograms␈αwhich␈αreside␈αin␈αthe␈αmini.␈α This␈αsystem␈α
includes
␈↓ ↓H␈↓kernel␈α
programs␈α∞for␈α
time-slice␈α
cpu␈α∞sharing␈α
and␈α
process␈α∞control␈α
and␈α
a␈α∞set␈α
of␈α∞dynamically␈α
created
␈↓ ↓H␈↓processes.␈α These␈αare␈αof␈αthree␈αbasic␈αtypes:␈αa)␈αAn␈αINTERPRETER␈αexamines␈αthe␈αcode␈αprepared␈α
by
␈↓ ↓H␈↓the␈α
compiler␈αand␈α
executes␈α
the␈αnumeric␈α
computations␈α
requested.␈α When␈α
a␈α
move␈αis␈α
to␈α
be␈αstarted,␈α
the
␈↓ ↓H␈↓interpreter␈α⊂creates␈α⊃a␈α⊂servo␈α⊂for␈α⊃each␈α⊂joint␈α⊃and␈α⊂waits␈α⊂until␈α⊃all␈α⊂these␈α⊂servos␈α⊃are␈α⊂finished.␈α⊃ b)␈α⊂A
␈↓ ↓H␈↓SERVO␈α⊂handles␈α⊂the␈α∂motion␈α⊂of␈α⊂one␈α⊂moving␈α∂joint.␈α⊂c)␈α⊂A␈α⊂CONDITION-MONITOR␈α∂repeatedly
␈↓ ↓H␈↓examines␈α
certain␈α
conditions␈α
(whatever␈αthe␈α
programmer␈α
has␈α
specified).␈α If␈α
it␈α
should␈α
discover␈αthat
␈↓ ↓H␈↓its condition has occurred, it creates an interpreter to take appropriate action.

␈↓ ↓H␈↓The␈αruntime␈αsystem␈αhas␈α
a␈αdatabase␈αwhich␈αstores␈α
the␈αcurrent␈αvalues␈αof␈α
all␈αactive␈αvariables␈αand␈α
the
␈↓ ↓H␈↓attachment␈α
relations␈α
between␈α
them.␈α Whenever␈α
an␈α
interpreter␈α
needs␈α
a␈αvalue,␈α
it␈α
is␈α
fetched␈αfrom␈α
this
␈↓ ↓H␈↓database.

␈↓ ↓H␈↓Facilities␈α
exist␈αfor␈α
control␈αof␈α
the␈αruntime␈α
system␈α
by␈αmeans␈α
of␈αthe␈α
mini's␈αconsole.␈α
 The␈αfeatures␈α
that
␈↓ ↓H␈↓are␈α
available␈α
include␈α
inspection␈α
of␈α
the␈α
status␈αof␈α
all␈α
active␈α
and␈α
dormant␈α
processes␈α
and␈α
the␈αvalues␈α
of
␈↓ ↓H␈↓all␈α∞variables,␈α∞as␈α∂well␈α∞as␈α∞the␈α∞insertion␈α∂of␈α∞breakpoints␈α∞and␈α∞the␈α∂ability␈α∞to␈α∞insert,␈α∞delete,␈α∂or␈α∞modify
␈↓ ↓H␈↓code.

␈↓ ↓H␈↓The␈αruntime␈αsystem␈αalso␈αincludes␈αroutines␈αfor␈αcommunication␈αwith␈αthe␈α(maxi's)␈αruntime␈αinterface.
␈↓ ↓H␈↓The runtime system is described in detail in Chapter  and Appendix II.

␈↓ ↓H␈↓REQUIRE "MCMPLR.PUB" SOURCE_FILE; <<MEMO61(2) Compiler overview>>
␈↓ ↓H␈↓Page 8␈α?␈α?␈α?␈α?␈α?␈α%GENERAL SYSTEM OUTLINE␈↓ ≡.1.2


















































␈↓ ↓H␈↓␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α¬Figure   .1
␈↓ ↓H␈↓␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α(Overall system
␈↓ ↓H␈↓.1.2␈α?␈α?␈α?␈α?␈α?␈α?␈αεGENERAL SYSTEM OUTLINE␈↓ 
pPage 9



␈↓ ↓H␈↓␈↓∧.2 DATA STRUCTURES␈↓



␈↓ ↓H␈↓␈↓β.2.1 DATA TYPES␈↓

␈↓ ↓H␈↓In␈α
this␈α
section␈α
we␈α
present␈α
the␈α
data␈α
types␈α
available␈α
in␈α
'AL.␈α
 Roughly␈α
speaking,␈α
a␈α
␈↓βdata␈α
type␈↓␈α
is␈α
a␈α
kind
␈↓ ↓H␈↓of␈α⊃numeric␈α⊃object.␈α⊃ For␈α⊃example,␈α⊃FORTRAN␈α∩has␈α⊃the␈α⊃data␈α⊃types␈α⊃INTEGER␈α⊃and␈α∩REAL.␈α⊃ A
␈↓ ↓H␈↓␈↓βvariable␈↓␈αis␈αan␈αidentifier␈αwhich␈αcan␈αtake␈αon␈α␈↓βvalues␈↓.␈α In␈α'AL,␈αeach␈αvariable␈αmust␈αbe␈α␈↓βdeclared␈↓,␈αthat␈α
is,
␈↓ ↓H␈↓one␈α
must␈α∞state␈α
what␈α∞its␈α
type␈α∞is,␈α
somewhere␈α∞in␈α
the␈α∞program␈α
before␈α∞it␈α
is␈α∞used.␈α
 There␈α∞are␈α
several
␈↓ ↓H␈↓reasons␈αfor␈αthis:␈αIt␈αallows␈αthe␈αcompiler␈αto␈αdetect␈αspelling␈αerrors,␈αand␈αit␈αallows␈αthe␈αsame␈αname␈αto␈αbe
␈↓ ↓H␈↓used␈αin␈αdifferent␈αblocks␈αwithout␈αconflict.␈α 'AL␈αuses␈αALGOL␈αblock␈αstructure,␈αwhich␈αmeans␈αthat␈αall
␈↓ ↓H␈↓variables␈α⊃declared␈α⊃between␈α⊃a␈α⊃particular␈α⊃BEGIN␈α⊃and␈α⊃END␈α⊃are␈α⊃accessible␈α⊃only␈α⊃to␈α⊃code␈α⊃which
␈↓ ↓H␈↓appears between the same BEGIN-END pair.



␈↓ ↓H␈↓␈↓β.2.2 ALGEBRAIC DATA TYPES: SCALARS␈↓

␈↓ ↓H␈↓Algebraic␈αdata␈α
types␈αare␈αthe␈α
most␈αfamiliar.␈α They␈α
represent␈αmeasurements␈αin␈α
the␈αreal␈α
world.␈α An
␈↓ ↓H␈↓algebraic␈α
variable␈α
can␈αassume␈α
a␈α
value␈α
by␈αmeans␈α
of␈α
the␈α
␈↓βassignment␈αstatement␈↓,␈α
which␈α
consists␈αof␈α
the
␈↓ ↓H␈↓variable␈α⊃name,␈α∩a␈α⊃left␈α∩arrow␈α⊃("←"),␈α⊃and␈α∩an␈α⊃expression␈α∩which␈α⊃has␈α⊃the␈α∩correct␈α⊃type.␈α∩ When␈α⊃an
␈↓ ↓H␈↓assignment␈α∂statement␈α∞is␈α∂executed,␈α∂the␈α∞expression␈α∂on␈α∂the␈α∞right␈α∂hand␈α∂side␈α∞is␈α∂evaluated,␈α∂and␈α∞that
␈↓ ↓H␈↓value replaces the old value of the variable on the left hand side.

␈↓ ↓H␈↓The␈α∩most␈α⊃elementary␈α∩data␈α∩type␈α⊃is␈α∩␈↓βsimple␈↓,␈α⊃which␈α∩is␈α∩internally␈α⊃represented␈α∩as␈α∩a␈α⊃floating-point
␈↓ ↓H␈↓number.␈α⊂ Simples␈α⊂are␈α⊂used␈α⊂for␈α⊂dimensionless␈α⊂scalar␈α⊂quantities,␈α⊂like␈α⊂the␈α⊂number␈α⊂of␈α⊂times␈α⊂some
␈↓ ↓H␈↓operation␈α
is␈α
to␈α
be␈α
repeated,␈α
or␈α
to␈αimplement␈α
a␈α
signal␈α
which␈α
becomes␈α
positive␈α
when␈α
some␈αcritical
␈↓ ↓H␈↓operation␈α∩is␈α∩finished.␈α∩ The␈α∩arithmetic␈α∩operations␈α∩available␈α∩on␈α∩simple␈α∩variables␈α∩are␈α∩addition,
␈↓ ↓H␈↓subtraction,␈αmultiplication,␈αand␈αdivision;␈αthe␈αarithmetic␈αoperators␈αwhich␈αperform␈αthese␈αoperations
␈↓ ↓H␈↓are␈αthe␈αstandard:␈α+,␈α-,␈α*,␈α/.␈α As␈αis␈αusual␈αin␈αalgebraic␈αlanguages,␈αthe␈αfirst␈αtwo␈αhave␈αlower␈αprecedence
␈↓ ↓H␈↓than the others.

␈↓ ↓H␈↓Simple␈α∞constants␈α∞are␈α
written␈α∞as␈α∞(base␈α
ten)␈α∞numbers,␈α∞either␈α
with␈α∞or␈α∞without␈α
a␈α∞decimal␈α∞point␈α
and
␈↓ ↓H␈↓fractional part.  Here are some examples of declarations and applications of simple variables:

␈↓ ↓H␈↓        SIMPLE S1, S2; {Our examples will use this rather stupid
␈↓ ↓H␈↓                scheme for naming variables, just to clarify what the
␈↓ ↓H␈↓                type of each entity is.  Please understand that
␈↓ ↓H␈↓                identifiers can be any string of letters, of any
␈↓ ↓H␈↓                length.}
␈↓ ↓H␈↓        S1 ← 2;
␈↓ ↓H␈↓        S2 ← 3.74;
␈↓ ↓H␈↓        S1 ← S2 * (S1 - 3.2);


␈↓ ↓H␈↓Often␈α
it␈α
is␈α
desirable␈α
to␈α
give␈α
some␈αphysical␈α
meaning␈α
to␈α
scalar␈α
variables.␈α
 'AL␈α
provides␈αfor␈α
variables
␈↓ ↓H␈↓with␈α⊃these␈α⊃special␈α⊃types:␈α⊂␈↓βtime,␈α⊃distance,␈α⊃angle,␈↓␈α⊃and␈α⊃␈↓βmass␈↓.␈α⊂ Time␈α⊃constants␈α⊃are␈α⊃just␈α⊃like␈α⊂simple
␈↓ ↓H␈↓Page 10␈α?␈α?␈α?␈α?␈α?␈α?␈α)DATA STRUCTURES␈↓ ≡.2.2



␈↓ ↓H␈↓constants,␈αexcept␈αthey␈αare␈αmultiplied␈αby␈αthe␈αreserved␈αword␈α␈↓βsec␈↓␈α(for␈α"seconds").␈α The␈αother␈αreserved
␈↓ ↓H␈↓words related to these "dimensioned" data types are ␈↓βcm␈↓ (centimeters), ␈↓βdeg␈↓ (degrees) and ␈↓βgm␈↓ (grams).

␈↓ ↓H␈↓Dimensioned␈αscalars␈αare␈αused␈α
exactly␈αin␈αthe␈αsame␈α
way␈αas␈αsimple␈αscalars;␈α
the␈αonly␈αdifference␈αis␈α
that
␈↓ ↓H␈↓'AL␈α
will␈αcheck␈α
to␈αassure␈α
that␈αaddition␈α
and␈αsubtraction␈α
are␈αonly␈α
performed␈αon␈α
compatible␈αvalues.
␈↓ ↓H␈↓'AL␈α∀performs␈α∀type␈α∀checking␈α∀for␈α∀each␈α∀arithmetic␈α∀operation␈α∀and␈α∀each␈α∀assignment.␈α∪ Addition,
␈↓ ↓H␈↓subtraction,␈α⊂and␈α⊂assignment␈α⊂require␈α⊂exact␈α⊂type␈α⊂match;␈α⊂multiplication␈α⊂and␈α⊂division␈α⊂do␈α⊂not,␈α⊂but
␈↓ ↓H␈↓produce␈α∂a␈α∂result␈α∞of␈α∂a␈α∂type␈α∞usually␈α∂different␈α∂from␈α∂that␈α∞of␈α∂the␈α∂arguments;␈α∞this␈α∂new␈α∂type␈α∂is␈α∞then
␈↓ ↓H␈↓propagated␈αthrough␈αthe␈α
expression.␈α In␈αthis␈αway,␈α
intermediate␈αresults␈αcan␈α
be␈αof␈αtypes␈αnot␈α
declared.
␈↓ ↓H␈↓This␈αcauses␈αno␈αproblem␈αunless␈αone␈αtries␈αto␈αuse␈αsuch␈αresults␈αin␈αan␈αassignment.␈α The␈αonly␈αexception
␈↓ ↓H␈↓to␈α
the␈α
type␈α
checking␈α
rules␈α
is␈α
that␈α
simple␈α
scalars␈α
are␈α
automatically␈α
converted␈α
to␈α
any␈α
other␈α
type␈α
if
␈↓ ↓H␈↓necessary to maintain type consistency.

␈↓ ↓H␈↓Here are some examples of dimensioned scalars:

␈↓ ↓H␈↓        TIME TM1, TM2;
␈↓ ↓H␈↓        MASS MS1;
␈↓ ↓H␈↓        ANGLE THETA, PHI;

␈↓ ↓H␈↓        TM1 ← 3 * SEC;
␈↓ ↓H␈↓        MS1 ← MS1 + 2.2 * GM;
␈↓ ↓H␈↓        MS1 ← MS1 + 2.2;  {The constant 2.2 will be automatically
␈↓ ↓H␈↓                converted to grams.}
␈↓ ↓H␈↓        THETA ← 90 * DEG;
␈↓ ↓H␈↓        TM1 ← TM2 * 5.5;
␈↓ ↓H␈↓        PHI ← THETA * 4 * DEG;  {This is a mistake;
␈↓ ↓H␈↓                the right side has type ␈↓βdeg*deg␈↓}


␈↓ ↓H␈↓If␈α
the␈α
user␈α
feels␈α
more␈α
comfortable␈α
with␈α
inches␈αor␈α
pounds,␈α
it␈α
is␈α
quite␈α
easy␈α
to␈α
write␈α
macros␈αwhich
␈↓ ↓H␈↓will make such usage possible.  This is best demonstrated by example:

␈↓ ↓H␈↓        DEFINE INCHES = "(2.54 * CM)";
␈↓ ↓H␈↓        DEFINE FEET = "(12 * INCHES)";
␈↓ ↓H␈↓        DEFINE LB = "(GM * 1000 / 2.2)";

␈↓ ↓H␈↓        MS1 ← 2.2*LB;  {= 1000*GM}
␈↓ ↓H␈↓        DS1 ← 3*FEET;  {= 3*12*2.54*CM}


␈↓ ↓H␈↓The␈αuser␈αmay␈αwish␈αto␈αcreate␈αnew␈αdimensioned␈α
scalars,␈αsuch␈αas␈αforces␈αor␈αvelocities.␈α This␈αis␈α
readily
␈↓ ↓H␈↓done by means of the ␈↓βdimension␈↓ statement and a few macros.  This shows how:
␈↓ ↓H␈↓.2.2␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α
DATA STRUCTURES␈↓ 
aPage 11



␈↓ ↓H␈↓        DIMENSION FORCE = DISTANCE*MASS/(TIME*TIME);
␈↓ ↓H␈↓        DEFINE DYNES = "(GM*CM/(SEC*SEC))";
␈↓ ↓H␈↓        DIMENSION VELOCITY = DISTANCE/TIME;
␈↓ ↓H␈↓        DEFINE CPS = "(CM/SEC)";

␈↓ ↓H␈↓        FORCE FO1;
␈↓ ↓H␈↓        VELOCITY VL1;
␈↓ ↓H␈↓        VL1 ← 2.3*CPS;
␈↓ ↓H␈↓        FO1 ← VL1 * 3 * GM / (8.4 * SEC);




␈↓ ↓H␈↓␈↓β.2.3 OTHER ALGEBRAIC DATA TYPES␈↓

␈↓ ↓H␈↓Scalars␈αare␈αinsufficient␈αto␈αdescribe␈αall␈αmeasurements␈αof␈αinterest␈αto␈αthe␈αuser␈αof␈α'AL.␈α We␈αturn␈αnow
␈↓ ↓H␈↓to␈αother␈αalgebraic␈αdata␈αtypes.␈α They␈αare␈αsyntactically␈αmuch␈αlike␈αscalars:␈αthey␈αare␈αdeclared␈αand␈αcan
␈↓ ↓H␈↓enter into arithmetic expressions and assignments.

␈↓ ↓H␈↓The␈αworld␈αin␈αwhich␈α'AL␈αresides␈αhas␈αthree␈αdimensions.␈α We␈αimpose␈αa␈αEuclidean␈αstructure␈αon␈αthat
␈↓ ↓H␈↓space␈α∪by␈α∪setting␈α∪up␈α∩three␈α∪cardinal,␈α∪orthogonal␈α∪axes,␈α∪which␈α∩meet␈α∪at␈α∪the␈α∪origin.␈α∪ The␈α∩actual
␈↓ ↓H␈↓alignment␈αof␈αthese␈α"table"␈αaxes␈αwill,␈αin␈αgeneral,␈αdepend␈αon␈αthe␈αparticular␈αwork␈αstation␈αinvolved;␈αit
␈↓ ↓H␈↓is expected, however, that the positive Z axis will point upwards (this is not at all crucial).

␈↓ ↓H␈↓The␈α∞first␈α∞data␈α∞type␈α∞we␈α∂will␈α∞discuss␈α∞is␈α∞the␈α∞␈↓βvector␈↓.␈α∞ It␈α∂represents␈α∞either␈α∞a␈α∞translational␈α∞offset␈α∂or␈α∞a
␈↓ ↓H␈↓location.␈α The␈αlatter␈αmeaning␈αis␈α
the␈αresult␈αof␈αtranslating␈αthe␈αnull␈α
vector,␈αthat␈αis,␈αthe␈αorigin␈α
of␈αthe
␈↓ ↓H␈↓coordinate system.

␈↓ ↓H␈↓It␈αis␈αpossible␈αto␈α"stretch"␈αor␈α"shrink"␈αvectors␈αby␈αmultiplying␈αand␈αdividing␈αthem␈αby␈αscalars.␈α There
␈↓ ↓H␈↓are␈α
these␈α
operations␈α
on␈α
two␈α
vectors:␈α
addition,␈α
subtraction,␈α
and␈α
dot␈α
product␈α
(using␈α
+,␈α
-␈α
and␈α
.).␈α If␈α
the
␈↓ ↓H␈↓two vectors are, say,

␈↓ ↓H␈↓        V1=VECTOR(X1,Y1,Z1) and V2=VECTOR(X2,Y2,Z2),

␈↓ ↓H␈↓then we have

␈↓ ↓H␈↓        S*V1 = VECTOR(S*X1,S*Y1,S*Z1)
␈↓ ↓H␈↓        V1+V2 = VECTOR(X1+X2,Y1+Y2,Z1+Z2)
␈↓ ↓H␈↓        V1-V2 = VECTOR(X1-X2,Y1-Y2,Z1-Z2)
␈↓ ↓H␈↓        V1.V2 = X1*X2 + Y1*Y2 + Z1*Z2    .


␈↓ ↓H␈↓Thus,␈αaddition␈α
and␈αsubtraction␈αproduce␈α
vectors␈αin␈αthe␈α
familiar␈αway;␈α
the␈αdot␈αproduct␈α
is␈αthe␈αsum␈α
of
␈↓ ↓H␈↓the␈αproducts␈αof␈αthe␈αthree␈αcoordinates␈αand␈αhas␈αtype␈α␈↓βdistance*distance␈↓.␈α The␈αmagnitude␈αof␈αa␈αvector
␈↓ ↓H␈↓is calculated by the function ABS, which returns a scalar of type distance.

␈↓ ↓H␈↓Vectors␈αcan␈αbe␈αconstructed␈αout␈αof␈αthree␈αdistance␈αexpressions␈αby␈αmeans␈αof␈αthe␈αfunction␈αVECTOR.
␈↓ ↓H␈↓Since␈αsimple␈αexpressions␈αcan␈αbe␈αcoerced␈αinto␈αdistance␈αexpressions,␈αsimple␈αexpressions␈α
suffice.␈α To
␈↓ ↓H␈↓extract the components of a vector, take dot products with the cardinal axes.
␈↓ ↓H␈↓Page 12␈α?␈α?␈α?␈α?␈α?␈α?␈α)DATA STRUCTURES␈↓ ≡.2.3



␈↓ ↓H␈↓There are three predeclared vectors in 'AL; they are the cardinal axes of the coordinate system:

␈↓ ↓H␈↓        VECTOR X, Y, Z; {These are predeclared and have values as follows}
␈↓ ↓H␈↓        X ← VECTOR(1,0,0);
␈↓ ↓H␈↓        Y ← VECTOR(0,1,0);
␈↓ ↓H␈↓        Z ← VECTOR(0,0,1);

␈↓ ↓H␈↓Here are examples of other vectors:

␈↓ ↓H␈↓        VECTOR V1, V2, V3;
␈↓ ↓H␈↓        SIMPLE S1;
␈↓ ↓H␈↓        DISTANCE D1;

␈↓ ↓H␈↓        D1 ← 4 * CM;
␈↓ ↓H␈↓        S1 ← -2;
␈↓ ↓H␈↓        V1 ← VECTOR(S1, 2.3, D1);
␈↓ ↓H␈↓        S1 ← V1 . Y;  {So S1 gets 2.3}
␈↓ ↓H␈↓        V2 ← V1 / S1;  {So V2 ← VECTOR(-2/2.3, 1, 4/2.3).}
␈↓ ↓H␈↓        V3 ← S1 * V2;  {So V3 ← V1}
␈↓ ↓H␈↓        S1 ← ABS(V1) + V2.V3; {This is a type mismatch!}

␈↓ ↓H␈↓The␈α
␈↓βrot␈↓,␈α
our␈α
next␈α
data␈αtype,␈α
represents␈α
either␈α
a␈α
rotational␈αoffset␈α
or␈α
an␈α
orientation.␈α
 The␈α
latter␈αis
␈↓ ↓H␈↓the␈α⊂result␈α⊃of␈α⊂applying␈α⊂the␈α⊃rotation␈α⊂to␈α⊃the␈α⊂fundamental␈α⊂coordinate␈α⊃system.␈α⊂ Rots␈α⊃are␈α⊂internally
␈↓ ↓H␈↓stored␈αas␈α3x3␈αmatrices,␈αwhich␈αoperate␈αon␈αcolumn␈αvectors␈αin␈αthe␈αusual␈αway.␈α Thus␈αrots␈αcan␈αoperate
␈↓ ↓H␈↓on␈α⊃vectors␈α⊃and␈α⊃move␈α⊃them␈α⊃around␈α⊃the␈α⊃origin␈α⊃(without␈α⊃changing␈α⊃their␈α⊃length);␈α⊃they␈α∩can␈α⊃also
␈↓ ↓H␈↓operate␈α⊃on␈α⊂other␈α⊃rots␈α⊂(by␈α⊃matrix␈α⊂multiplication).␈α⊃ To␈α⊂rotate␈α⊃a␈α⊂vector␈α⊃(about␈α⊂the␈α⊃table␈α⊂origin),
␈↓ ↓H␈↓multiply␈α
the␈α
vector␈α
(on␈α
the␈α
right)␈α
by␈α
the␈α
rot␈α
(on␈α
the␈α
left).␈α
 To␈α
compose␈α
rots,␈α
multiply␈αthem␈α
together;
␈↓ ↓H␈↓the one on the right will be applied first.

␈↓ ↓H␈↓A␈α
rotation␈αcan␈α
be␈α
constructed␈αwith␈α
the␈α
function␈αROT,␈α
which␈α
takes␈αtwo␈α
arguments:␈α
a␈αvector,␈α
which
␈↓ ↓H␈↓is␈αto␈αbe␈αthe␈αaxis␈αof␈αrotation,␈αand␈αan␈αangle,␈αwhich␈αis␈αthe␈αamount␈αto␈αrotate.␈α This␈αturns␈αout␈αto␈αbe␈αa
␈↓ ↓H␈↓general␈α∩representation␈α∩far␈α∩easier␈α∪to␈α∩write␈α∩and␈α∩understand␈α∪than␈α∩raw␈α∩matrices.␈α∩ We␈α∪hope␈α∩the
␈↓ ↓H␈↓following examples will serve to clarify the proper use of rots:
␈↓ ↓H␈↓.2.3␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α
DATA STRUCTURES␈↓ 
aPage 13



␈↓ ↓H␈↓        ROT R1, R2, R3;
␈↓ ↓H␈↓        ANGLE ALPHA, BETA, GAMMA;
␈↓ ↓H␈↓        R1 ← ROT(X, 90*DEG);
␈↓ ↓H␈↓        V1 ← R1 * Z;
␈↓ ↓H␈↓␈↓ βλ␈↓β{V1 gets Z rotated 90 degrees about X, so V1 ← VECTOR(0,-1,0).}
␈↓ ↓H␈↓        R2 ← ROT(Y, 45*DEG);
␈↓ ↓H␈↓        R3 ← R2 * R1;
␈↓ ↓H␈↓␈↓ βλ␈↓β{Thus,␈α
R3␈αmeans:␈α
rotate␈αfirst␈α
90␈αdegrees␈α
about␈αthe␈α
X␈αaxis,␈α
then␈α45␈α
about␈αthe␈α
original
␈↓ ↓H␈↓β␈↓ βλY axis.}

␈↓ ↓H␈↓        R1 ← ROT(X,ALPHA);
␈↓ ↓H␈↓        R2 ← ROT(R1*Y,BETA);
␈↓ ↓H␈↓        R3 ← ROT(R2*Z,GAMMA);
␈↓ ↓H␈↓        R4 ← R3 * R2 * R1;
␈↓ ↓H␈↓␈↓ βλ␈↓β{R4␈αis␈αthen␈αa␈αrotation␈αwith␈αthis␈α
meaning:␈αRotate␈αby␈αalpha␈αdegrees␈αabout␈αthe␈α
X␈αaxis,
␈↓ ↓H␈↓β␈↓ βλthen␈α
by␈α
beta␈α
degrees␈α
about␈α
the␈α
new␈α∞Y␈α
axis,␈α
then␈α
by␈α
gamma␈α
degrees␈α
about␈α∞the␈α
doubly
␈↓ ↓H␈↓β␈↓ βλnew Z axis.}

␈↓ ↓H␈↓The␈α
next␈α
data␈α
type␈α
is␈α
the␈α
␈↓βframe␈↓,␈α
used␈α
to␈α
represent␈α
a␈α
coordinate␈α
system.␈α
 It␈α
has␈α
two␈αcomponents:␈α
the
␈↓ ↓H␈↓location␈αof␈αthe␈αorigin␈α(a␈αvector)␈αand␈αthe␈αorientation␈αof␈αthe␈αaxes␈α(a␈αrot).␈α Frames␈αare␈αtypically␈αused
␈↓ ↓H␈↓to␈αdescribe␈α
objects;␈αone␈α
can␈αspecify␈α
locations␈αof␈αfeatures␈α
on␈αan␈α
object␈αby␈α
translating␈αthem␈αfrom␈α
the
␈↓ ↓H␈↓object's origin.

␈↓ ↓H␈↓There␈α⊃are␈α⊂several␈α⊃predeclared␈α⊃frames␈α⊂in␈α⊃'AL.␈α⊃ ␈↓βTable␈↓␈α⊂is␈α⊃the␈α⊃frame␈α⊂which␈α⊃represents␈α⊃the␈α⊂work
␈↓ ↓H␈↓station's␈αframe␈αof␈αreference.␈α Each␈αhand␈αavailable␈αto␈αthe␈αsystem␈αalso␈αhas␈αa␈αframe␈αvariable,␈αwhose
␈↓ ↓H␈↓value␈α∞(continually␈α∞updated)␈α∞is␈α∞the␈α∞position␈α∞of␈α
that␈α∞hand.␈α∞ Currently,␈α∞there␈α∞are␈α∞two␈α∞such␈α
frames:
␈↓ ↓H␈↓␈↓βyellow␈↓ and ␈↓βblue␈↓.  Each arm has a rest, or park position, known as ␈↓βypark␈↓ and ␈↓βbpark␈↓.

␈↓ ↓H␈↓A␈α∞frame␈α∂may␈α∞be␈α∞constructed␈α∂by␈α∞a␈α∂call␈α∞on␈α∞the␈α∂function␈α∞FRAME,␈α∞which␈α∂takes␈α∞two␈α∂arguments:␈α∞a
␈↓ ↓H␈↓vector␈α
(for␈α
the␈α∞position)␈α
and␈α
a␈α
rot␈α∞(for␈α
the␈α
orientation).␈α∞To␈α
extract␈α
the␈α
vector␈α∞or␈α
the␈α
rot␈α∞from␈α
a
␈↓ ↓H␈↓frame,␈α
use␈αthe␈α
functions␈α
LOC␈αand␈α
ORIENT,␈αrespectively.␈α
 To␈α
find␈αwhere␈α
a␈α
vector␈αgoes␈α
if␈αits␈α
base
␈↓ ↓H␈↓is␈αmoved␈αfrom␈αthe␈αtable␈αto␈αthe␈αcoordinate␈αsystem␈αof␈αsome␈αframe,␈α"multiply"␈αthe␈αframe␈α(on␈αthe␈α
left)
␈↓ ↓H␈↓by␈αthe␈αvector␈α(on␈αthe␈αright).␈α Often␈αone␈αwants␈α
to␈αconstruct␈αa␈αvector␈αwhich␈αis␈αoriented␈αlike,␈αsay,␈α
the
␈↓ ↓H␈↓X␈α⊂vector␈α⊃in␈α⊂some␈α⊃frame,␈α⊂say␈α⊃F1.␈α⊂ The␈α⊂␈↓βwith␈α⊃respect␈α⊂to␈↓␈α⊃operator␈α⊂gives␈α⊃exactly␈α⊂that;␈α⊃one␈α⊂writes
␈↓ ↓H␈↓(X WRT F1).  Examples of this and other constructs pertaining to frames follow.

␈↓ ↓H␈↓        FRAME F1, F2, F3;
␈↓ ↓H␈↓        F1 ← FRAME(2*X, ROT(Z,90*DEG);
␈↓ ↓H␈↓                {F1 sits 2 centimeters from the table, in the X
␈↓ ↓H␈↓                direction.  Its coordinate system has X where the
␈↓ ↓H␈↓                table's Y points.}
␈↓ ↓H␈↓        V1 ← X WRT F1;
␈↓ ↓H␈↓                {This evaluates to VECTOR(0,1,0)}
␈↓ ↓H␈↓        V1 ← F1 * Y;
␈↓ ↓H␈↓                {This evaluates to VECTOR(0,0,0)}
␈↓ ↓H␈↓        V2 ← V3 WRT F2;
␈↓ ↓H␈↓                {This is equivalent to (F2*V3) - LOC(F2)}
␈↓ ↓H␈↓Page 14␈α?␈α?␈α?␈α?␈α?␈α?␈α)DATA STRUCTURES␈↓ ≡.2.3



␈↓ ↓H␈↓Next␈αwe␈αhave␈αthe␈α␈↓βplane␈↓,␈αused␈αto␈αseparate␈α
space␈αinto␈αregions␈αand␈αto␈αspecify␈αthe␈αlocus␈α
of␈αsearches.
␈↓ ↓H␈↓Planes␈α∞are␈α∞formed␈α∞by␈α∞use␈α∞of␈α∞the␈α∂function␈α∞PLANE,␈α∞which␈α∞takes␈α∞two␈α∞vectors␈α∞as␈α∂arguments:␈α∞The
␈↓ ↓H␈↓plane␈α∞is␈α∞to␈α∞pass␈α∞through␈α∞the␈α∞first␈α∞vector,␈α∞and␈α∞the␈α∞outward-facing␈α∞normal␈α∞to␈α∞the␈α∞plane␈α∞is␈α∞in␈α∞the
␈↓ ↓H␈↓direction␈α
of␈αthe␈α
second␈αvector.␈α
 Thus␈αPLANE(X,Y)␈α
is␈αa␈α
plane␈αparallel␈α
to␈αthe␈α
X-Z␈αplane,␈α
translated
␈↓ ↓H␈↓from it by one centimeter in the X direction.

␈↓ ↓H␈↓Planes␈α
are␈α
internally␈α
stored␈α∞by␈α
four␈α
numbers:␈α
the␈α
first␈α∞three␈α
are␈α
an␈α
outward-facing␈α∞normal,␈α
and
␈↓ ↓H␈↓the last is the opposite of the distance from the plane to the origin.

␈↓ ↓H␈↓Each␈α⊂plane␈α⊃divides␈α⊂space␈α⊃into␈α⊂three␈α⊂regions:␈α⊃inside,␈α⊂on,␈α⊃and␈α⊂outside␈α⊂the␈α⊃plane.␈α⊂ (The␈α⊃last␈α⊂set
␈↓ ↓H␈↓contains␈αall␈αpoints␈αon␈α
the␈αside␈αof␈αthe␈αplane␈α
towards␈αthe␈αoutward-facing␈αnormal,␈αfor␈α
instance.)␈αTo
␈↓ ↓H␈↓find␈α
out␈α
in␈α
which␈α
region␈α
a␈α
point␈α
(represented␈α
by␈α
a␈α
vector)␈α
lies,␈α
extract␈α
the␈α
inner␈α
product␈α∞of␈α
the
␈↓ ↓H␈↓vector␈αwith␈αthe␈αplane.␈α Its␈αvalue␈αis␈αa␈αdistance␈αscalar␈αwhose␈αabsolute␈αvalue␈αis␈αthe␈α
shortest␈αdistance
␈↓ ↓H␈↓from␈αthe␈αvector␈αto␈αthe␈αplane,␈αand␈αwhose␈αsign␈αis␈αnegative␈αif␈αthe␈αvector␈αis␈αinside␈αthe␈αplane,␈α0␈αif␈αthe
␈↓ ↓H␈↓vector␈αis␈α
on␈αthe␈α
plane,␈αand␈αpositive␈α
if␈αthe␈α
vector␈αis␈αoutside␈α
the␈αplane.␈α
 The␈αarithmetic␈αoperator␈α
for
␈↓ ↓H␈↓the␈α∞inner␈α
product␈α∞is␈α∞a␈α
dot;␈α∞the␈α
plane␈α∞must␈α∞appear␈α
on␈α∞the␈α
left␈α∞of␈α∞the␈α
dot␈α∞and␈α
the␈α∞vector␈α∞on␈α
the
␈↓ ↓H␈↓right.␈α∂ If␈α∞the␈α∂plane␈α∞P␈α∂has␈α∞internal␈α∂representation␈α∞with␈α∂four␈α∞numbers␈α∂A,␈α∞B,␈α∂C,␈α∞and␈α∂D,␈α∂then␈α∞we
␈↓ ↓H␈↓have:

␈↓ ↓H␈↓        P.V = A*X1 + B*X2 * C*X3 + D


␈↓ ↓H␈↓Other␈α∩operations␈α∪available␈α∩on␈α∪planes␈α∩are␈α∪translation␈α∩(by␈α∪adding␈α∩a␈α∪vector)␈α∩and␈α∪rotation␈α∩(by
␈↓ ↓H␈↓multiplying␈α∩by␈α∩a␈α∪rotation).␈α∩ To␈α∩get␈α∪the␈α∩outward-facing␈α∩normal␈α∩of␈α∪a␈α∩plane,␈α∩use␈α∪the␈α∩function
␈↓ ↓H␈↓NORMAL, which takes a plane argument and returns a vector.

␈↓ ↓H␈↓Examples:

␈↓ ↓H␈↓        PLANE P1, P2;
␈↓ ↓H␈↓        P1 ← PLANE(VECTOR(0,0,0),Z);
␈↓ ↓H␈↓                {This is the surface of the table}
␈↓ ↓H␈↓        V1 ← NORMAL(P1 + V2);
␈↓ ↓H␈↓                {No matter what V2 is, V1 will get Z}
␈↓ ↓H␈↓        DS1 ← P1 ␈↓∧.␈↓ VECTOR(2, -13.2, 32.3);
␈↓ ↓H␈↓                {DS1 gets 32.3*cm}

␈↓ ↓H␈↓The␈αlast␈αof␈αthe␈αalgebraic␈αdata␈αtypes␈αis␈αthe␈α␈↓βtrans␈↓,␈αwhich␈αstands␈αfor␈α"transform".␈α It␈αis␈αan␈αoperator,
␈↓ ↓H␈↓that␈αis,␈αa␈αfunction,␈αwhich␈αcan␈αoperate␈αon␈αvectors,␈αframes,␈αand␈αplanes.␈α The␈αapplication␈αof␈αa␈αtrans
␈↓ ↓H␈↓to␈α
any␈α
of␈α∞these␈α
is␈α
written␈α∞as␈α
if␈α
it␈α∞were␈α
a␈α
multiplication,␈α∞with␈α
the␈α
trans␈α∞on␈α
the␈α
left.␈α∞ To␈α
compose
␈↓ ↓H␈↓several transes together, "multiply" them, with the one to be applied first on the right.

␈↓ ↓H␈↓The␈α∞trans␈α∞itself␈α∞is␈α∞defined␈α
as␈α∞a␈α∞function␈α∞which␈α∞can␈α∞take␈α
objects␈α∞in␈α∞one␈α∞frame␈α∞of␈α∞reference␈α
into
␈↓ ↓H␈↓another.␈α One␈αcan␈αconstruct␈α
a␈αtrans␈αby␈αuse␈α
of␈αthe␈αfunction␈αTRANS,␈α
which␈αtakes␈αtwo␈αarguments:␈α
a
␈↓ ↓H␈↓vector␈α(the␈αtranslational␈αpart)␈αand␈αa␈αrotation␈α(the␈α
rotational␈αpart).␈α The␈αapplication␈αof␈αa␈αtrans␈αto␈α
a
␈↓ ↓H␈↓vector,␈α
frame,␈αor␈α
plane␈α
first␈αrotates␈α
that␈αobject␈α
according␈α
to␈αthe␈α
rotation␈αpart␈α
(rotating␈α
about␈αthe
␈↓ ↓H␈↓table␈αorigin),␈αand␈α
then␈αtranslates␈αthe␈αresult␈α
according␈αto␈αthe␈αtranslational␈α
part.␈α When␈αa␈α
frame␈αis
␈↓ ↓H␈↓used␈αin␈αa␈αcontext␈αdemanding␈αa␈αtransformation,␈αit␈αwill␈αbe␈αunderstood␈αas␈αa␈αshorthand␈αfor␈αthe␈αtrans
␈↓ ↓H␈↓leading␈α
from␈αthe␈α
table;␈α
thus␈αwe␈α
see␈α
that␈αthe␈α
expression␈α
F1*V1␈αis␈α
really␈α
the␈αapplication␈α
of␈αthe␈α
trans
␈↓ ↓H␈↓"TABLE→F1" to the vector.
␈↓ ↓H␈↓.2.3␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α
DATA STRUCTURES␈↓ 
aPage 15



␈↓ ↓H␈↓There␈αis␈αanother␈αconvenient␈αway␈αto␈αspecify␈αa␈αtrans:␈αby␈αforming␈αit␈αfrom␈αtwo␈αframes.␈α The␈αtrans␈αis
␈↓ ↓H␈↓then␈α∂the␈α∂function␈α∞which␈α∂takes␈α∂the␈α∞origin␈α∂of␈α∂the␈α∂first␈α∞frame␈α∂across␈α∂to␈α∞the␈α∂origin␈α∂of␈α∂the␈α∞second,
␈↓ ↓H␈↓performing␈α∪a␈α∀rotation␈α∪first␈α∪to␈α∀get␈α∪the␈α∪axes␈α∀aligned.␈α∪ This␈α∪method␈α∀of␈α∪specifying␈α∪a␈α∀trans␈α∪is
␈↓ ↓H␈↓accomplished by use of the arithmetic operator "→".

␈↓ ↓H␈↓Examples:

␈↓ ↓H␈↓        TRANS T1, T2;
␈↓ ↓H␈↓        T1 ← F1→F2;
␈↓ ↓H␈↓                {Thus T1*F1 = F2}
␈↓ ↓H␈↓        V1 ← T1*V2;
␈↓ ↓H␈↓        T2 ← T1*T1;
␈↓ ↓H␈↓        V1 ← F1*V2;  {Equivalent to (TABLE→F1)*V2}




␈↓ ↓H␈↓␈↓β.2.4 PLANNING VALUES␈↓

␈↓ ↓H␈↓'AL␈α∞works␈α
under␈α∞the␈α
fundamental␈α∞philosophy␈α
that␈α∞arm␈α
motions␈α∞should␈α
be␈α∞planned␈α∞in␈α
advance.
␈↓ ↓H␈↓Since␈αan␈α
arm␈αtrajectory␈α
cannot␈αbe␈α
calculated␈αreasonably␈α
unless␈αthe␈α
end-points␈α(and␈α
any␈αspecified
␈↓ ↓H␈↓intermediate␈α∂points)␈α∂are␈α∂known␈α∂fairly␈α∂accurately,␈α∂it␈α∂is␈α∂necessary␈α∂that␈α∂the␈α∂compiler␈α∂maintain␈α∂for
␈↓ ↓H␈↓each␈α∞variable␈α∞a␈α∂␈↓βplanning␈α∞value␈↓␈α∞which␈α∂may␈α∞be␈α∞used␈α∞in␈α∂the␈α∞case␈α∞that␈α∂the␈α∞variable␈α∞enters␈α∂into␈α∞a
␈↓ ↓H␈↓motion␈α∞specification.␈α
 We␈α∞will␈α
not␈α∞discuss␈α
here␈α∞the␈α
results␈α∞of␈α
poor␈α∞values␈α
at␈α∞planning␈α∞time;␈α
that
␈↓ ↓H␈↓has␈αbeen␈α
well␈αcovered␈α
earlier.␈α What␈α
is␈αof␈αimportance␈α
is␈αthat␈α
the␈αcompiler␈α
assigns␈αto␈αeach␈α
variable
␈↓ ↓H␈↓a planning value at each statement in the program.

␈↓ ↓H␈↓Initially,␈α∂the␈α∂planning␈α∂value␈α∂of␈α∂each␈α∂variable␈α⊂is␈α∂"undefined";␈α∂one␈α∂of␈α∂the␈α∂ways␈α∂that␈α⊂a␈α∂planning
␈↓ ↓H␈↓value␈αcan␈αbe␈αassumed␈αis␈αthrough␈α
an␈αassignment␈αstatement.␈α The␈αcompiler␈αevaluates␈α
the␈αplanning
␈↓ ↓H␈↓value of the right hand side, and this becomes the new planning value of the variable on the left.

␈↓ ↓H␈↓Propagating␈αthe␈αplanning␈αvalue␈αacross␈αloops␈αis␈αcomplicated;␈αin␈αthe␈αcase␈αthat␈αthe␈αvariable␈αcan␈αtake
␈↓ ↓H␈↓multiple␈α∂values,␈α∂the␈α∞compiler␈α∂either␈α∂sets␈α∂the␈α∞planning␈α∂value␈α∂to␈α∞"undefined"␈α∂or,␈α∂as␈α∂'AL␈α∞becomes
␈↓ ↓H␈↓more advanced, maintains parallel "worlds" in which each planning value is monovalued.

␈↓ ↓H␈↓Variables␈α
can␈α
attain␈α
different␈α
values␈α
at␈αrun-time␈α
than␈α
their␈α
planning␈α
values␈α
when␈αsome␈α
real-world
␈↓ ↓H␈↓measurement␈α∪is␈α∪taken␈α∪and␈α∪the␈α∪result␈α∪used␈α∪in␈α∪an␈α∪arithmetic␈α∪expression.␈α∪ The␈α∪most␈α∩common
␈↓ ↓H␈↓example␈αof␈αthis␈αis␈αthat␈αthe␈αframes␈αYELLOW␈αand␈αBLUE␈αare␈αalways␈αkept␈αaccurate␈αat␈αrun-time␈αby
␈↓ ↓H␈↓feedback from the arm hardware, so their values will in general differ from those planned.

␈↓ ↓H␈↓There␈α∂is␈α∞an␈α∂arithmetic␈α∞operator␈α∂which,␈α∂when␈α∞applied␈α∂to␈α∞any␈α∂variable␈α∞or␈α∂expression␈α∂returns␈α∞its
␈↓ ↓H␈↓planning␈α
value.␈α
 This␈α
is␈α
the␈α
hash␈α
mark␈α
("#").␈α
 Expressions␈α
such␈α
as␈α
#(FROB)␈α
or␈α∞#(3 * S1)␈α
always
␈↓ ↓H␈↓evaluate to constants; repeated application of the hash operator is, in effect, ignored.

␈↓ ↓H␈↓There␈α∞is␈α∂one␈α∞other␈α∞way␈α∂to␈α∞affect␈α∂the␈α∞planning␈α∞value␈α∂of␈α∞a␈α∂variable,␈α∞and␈α∞that␈α∂is␈α∞by␈α∂the␈α∞␈↓βpseudo-
␈↓ ↓H␈↓βassignment␈↓␈α⊃statement.␈α⊃ This␈α⊃looks␈α⊃just␈α⊃like␈α⊂an␈α⊃assignment␈α⊃statement,␈α⊃except␈α⊃the␈α⊃operator␈α⊃is␈α⊂a
␈↓ ↓H␈↓double␈αleft␈αarrow␈α("←←").␈α The␈αright-hand␈αside␈αof␈αthe␈αstatement␈αis␈αevaluated,␈αand␈αthis␈αbecomes␈αthe
␈↓ ↓H␈↓planning␈α⊂value␈α⊃of␈α⊂the␈α⊃left-hand␈α⊂side.␈α⊂ Note␈α⊃that␈α⊂for␈α⊃all␈α⊂the␈α⊂data␈α⊃types␈α⊂so␈α⊃far␈α⊂discussed,␈α⊃it␈α⊂is
␈↓ ↓H␈↓Page 16␈α?␈α?␈α?␈α?␈α?␈α?␈α)DATA STRUCTURES␈↓ ≡.2.4



␈↓ ↓H␈↓essential␈α∂that␈α∞the␈α∂expression␈α∞on␈α∂the␈α∞right␈α∂hand␈α∞side␈α∂be␈α∞either␈α∂a␈α∞constant␈α∂or␈α∞made␈α∂up␈α∂solely␈α∞of
␈↓ ↓H␈↓constants; the compiler will not assume the presence of the planning value operator if it is missing.

␈↓ ↓H␈↓Here is an example of a loop, showing what planning values obtain at various places:

␈↓ ↓H␈↓␈↓ αHSIMPLE A, B, C;
␈↓ ↓H␈↓␈↓ αHA  ← 1;
␈↓ ↓H␈↓␈↓ αHB  ← 1;
␈↓ ↓H␈↓␈↓ αHC  ← 1;
␈↓ ↓H␈↓␈↓ αHWHILE <condition> DO
␈↓ ↓H␈↓␈↓ αH        BEGIN
␈↓ ↓H␈↓␈↓ αH        {#(A)=1, #(B)=UNDEFINED, #(C)=UNDEFINED}
␈↓ ↓H␈↓␈↓ αH        B ← 3;
␈↓ ↓H␈↓␈↓ αH        {#(A)=1, #(B)=3, #(C)=UNDEFINED}
␈↓ ↓H␈↓␈↓ αH        C ←← #(B);
␈↓ ↓H␈↓␈↓ αH        B ← 4;
␈↓ ↓H␈↓␈↓ αH        {#(A)=1, #(B)=4, #(C)=3}
␈↓ ↓H␈↓␈↓ αH        END;
␈↓ ↓H␈↓␈↓ αH{#(A)=1, #(B)=UNDEFINED, #(C)=UNDEFINED}




␈↓ ↓H␈↓␈↓β.2.5 ARITHMETIC␈↓

␈↓ ↓H␈↓Here␈α
is␈α
a␈αsummary␈α
of␈α
the␈αarithmetic␈α
expressions␈α
available.␈α They␈α
are␈α
grouped␈αby␈α
the␈α
type␈αof␈α
their
␈↓ ↓H␈↓values.␈α These␈αabbreviations␈α
are␈αused:␈α`s'␈α
=␈αscalar,␈α`v'␈α
=␈αvector,␈α`r'␈α
=␈αrot,␈α`f'␈α
=␈αframe,␈α`p'␈α
=␈αplane,␈α`t'␈α
=
␈↓ ↓H␈↓trans.  ␈↓ε
␈↓ ↓H␈↓εscalar expressions:
␈↓ ↓H␈↓εs + s           scalar addition (commutative)
␈↓ ↓H␈↓εs - s           scalar subtraction
␈↓ ↓H␈↓εs * s           scalar multiplication (commutative)
␈↓ ↓H␈↓εs / s           scalar division
␈↓ ↓H␈↓εv . v           dot product of two vectors (commutative)
␈↓ ↓H␈↓εp . v           signed distance from vector to plane (see discussion
␈↓ ↓H␈↓ε                        above on planes)

␈↓ ↓H␈↓εvector expressions:
␈↓ ↓H␈↓εs * v           dilation of a vector
␈↓ ↓H␈↓εv / s           contraction of a vector
␈↓ ↓H␈↓εv + v           vector addition (translation of the first vector by 
␈↓ ↓H␈↓ε                        the second) (commutative)
␈↓ ↓H␈↓εv - v           vector subtraction
␈↓ ↓H␈↓εr * v           rotation of a vector
␈↓ ↓H␈↓εt * v           transformation of a vector
␈↓ ↓H␈↓εv WRT f         a vector of length ABS(v) rotated into f's system; like
␈↓ ↓H␈↓ε                        ORIENT(f)*v; that is, a vector in table
␈↓ ↓H␈↓ε                        coordinates which looks to the table as v
␈↓ ↓H␈↓ε                        does to f.
␈↓ ↓H␈↓εrot expressions:
␈↓ ↓H␈↓εr * r           composition of two rots (first to be applied is on the 
␈↓ ↓H␈↓ε                        right)
␈↓ ↓H␈↓.2.5␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α
DATA STRUCTURES␈↓ 
aPage 17



␈↓ ↓H␈↓εframe expressions:
␈↓ ↓H␈↓εt * f           transformation of a frame

␈↓ ↓H␈↓εplane expressions:
␈↓ ↓H␈↓εp + v           translation of a plane by a vector
␈↓ ↓H␈↓εr * p           rotation of plane (about table origin)
␈↓ ↓H␈↓εt * p           transformation of a plane by a trans

␈↓ ↓H␈↓εtrans expressions:
␈↓ ↓H␈↓εf → f           transformation which leads from the first frame to
␈↓ ↓H␈↓ε                        the second
␈↓ ↓H␈↓εt * t           composing two transes.  The one on the right will opera
␈↓ ↓H␈↓ε                        first.

␈↓ ↓H␈↓εPREDECLARED CONSTANTS AND VARIABLES:

␈↓ ↓H␈↓επ is simple, has value = 3.14159...
␈↓ ↓H␈↓εTABLE is a frame which has standard table coordinates. (constant)
␈↓ ↓H␈↓εBLUE is the location of the blue hand.
␈↓ ↓H␈↓εYELLOW is the location of the yellow hand.
␈↓ ↓H␈↓εBPARK is where the blue hand parks. (constant)
␈↓ ↓H␈↓εYPARK is where the yellow hand parks. (constant)
␈↓ ↓H␈↓εX is VECTOR(1,0,0).
␈↓ ↓H␈↓εY is VECTOR(0,1,0).
␈↓ ↓H␈↓εZ is VECTOR(0,0,1).

␈↓ ↓H␈↓Any␈αexpression␈αpreceeded␈αwith␈αthe␈αsymbol␈α"#"␈α
means␈α"the␈αplanning␈αvalue␈αof␈αthis␈αexpression",␈α
that
␈↓ ↓H␈↓is, a constant is substituted for the entire expression in the expander.


␈↓ ↓H␈↓EXTRACTION FUNCTIONS:

␈↓ ↓H␈↓LOC(FRAME) is a vector whose value is the location of the frame.
␈↓ ↓H␈↓ORIENT(FRAME) is a rot whose value is the orientation of the frame.
␈↓ ↓H␈↓NORMAL(PLANE)   is the outward facing normal vector of a plane.




␈↓ ↓H␈↓␈↓β.2.6 SOME EXAMPLES OF ARITHMETIC EXPRESSIONS␈↓

␈↓ ↓H␈↓In the following examples, assume these declarations:
␈↓ ↓H␈↓FRAME F1, F2, etc;
␈↓ ↓H␈↓VECTOR V1, V2, etc;
␈↓ ↓H␈↓SIMPLE S1, S2, etc;
␈↓ ↓H␈↓ROT R1, R2, etc;
␈↓ ↓H␈↓PLANE P1, P2, etc;

␈↓ ↓H␈↓F1'S unit Y vector, in TABLE coordinates:
␈↓ ↓H␈↓        F1 * Y
␈↓ ↓H␈↓Page 18␈α?␈α?␈α?␈α?␈α?␈α?␈α)DATA STRUCTURES␈↓ ≡.2.6



␈↓ ↓H␈↓F1's Z vector as seen from F2:
␈↓ ↓H␈↓        (F2→F1) * Z

␈↓ ↓H␈↓A vector pointing in same direction as F1's X coordinate:
␈↓ ↓H␈↓        X WRT F1

␈↓ ↓H␈↓V1 rotated 90 degrees about the table's Z axis:
␈↓ ↓H␈↓        ROT(Z,90*DEG)*V1

␈↓ ↓H␈↓F1's Y-Z plane:
␈↓ ↓H␈↓        PLANE(LOC(F1),X WRT F1)

␈↓ ↓H␈↓A plane 3 centimeters above the table:
␈↓ ↓H␈↓        PLANE(VECTOR(0,0,3),Z);
␈↓ ↓H␈↓        PLANE(3*Z,Z);

␈↓ ↓H␈↓An identity with WRT:
␈↓ ↓H␈↓        V1 WRT F1 = ORIENT(F1)*V1 = (F1*V1) - LOC(F1)

␈↓ ↓H␈↓REQUIRE␈α∂"MMOTNS.PUB"␈α∂SOURCE_FILE;␈α∂<<MEMO61(12:17)␈α∂Motion␈α∂specs>>␈α∂REQUIRE
␈↓ ↓H␈↓"MCTRST.PUB"␈α+SOURCE_FILE;␈α*<<MEMO61(3:7)␈α+Control␈α+structures>>␈α*REQUIRE
␈↓ ↓H␈↓"MAFFIX.PUB"␈α∂SOURCE_FILE;␈α∞<<MEMO61(18)␈α∂Affixments>>␈α∂REQUIRE␈α∞"MGRAPH.PUB"
␈↓ ↓H␈↓SOURCE_FILE;␈α.<<MEMO61(19)␈α.Graph␈α.structures>>␈α/REQUIRE␈α."MCTCTS.PUB"
␈↓ ↓H␈↓SOURCE_FILE;␈α~<<MEMO63(2:7)␈α~Compile␈α~time␈α~constructs>>␈α~REQUIRE␈α→"MLIBRT.PUB"
␈↓ ↓H␈↓SOURCE_FILE;␈α<<MEMO63(8)␈αLibrary␈αroutines>>␈αREQUIRE␈α"MVHL.PUB"␈αSOURCE_FILE;
␈↓ ↓H␈↓<<MEMO64␈α∀Very␈α∀high␈α∀level>>␈α∀REQUIRE␈α∀"MRUNTM.PUB"␈α∀SOURCE_FILE;␈α∪<<MEMO7
␈↓ ↓H␈↓Runtime␈α∪overview>>␈α∪REQUIRE␈α∪"MUSER.PUB"␈α∪SOURCE_FILE;␈α∪<<MEMO8␈α∪User␈α∩features,
␈↓ ↓H␈↓dialog>>␈α∩REQUIRE␈α∩"MEXTNS.PUB"␈α∩SOURCE_FILE;␈α∩<<MEMO9␈α∩Extensions>>␈α⊃REQUIRE
␈↓ ↓H␈↓"MCNCBB.PUB" SOURCE_FILE; <<MEMO10 Conclusions, bibligoraphy>>
␈↓ ↓H␈↓.2.6␈α?␈α?␈α?␈α?␈α?␈α?␈α?␈α
DATA STRUCTURES␈↓ 
aPage 19



␈↓ ↓H␈↓REQUIRE␈α∂"MXMPLS.PUB"␈α∂SOURCE_FILE;␈α∂<<XMPLES␈α∂Examples:␈α∂appendix>>␈α∂REQUIRE
␈↓ ↓H␈↓"MTRAPP.PUB" SOURCE_FILE; <<RUNTIM Runtime details: appendix>>